From 032a334035bf4a394f36d66e2bfb144b000ebb41 Mon Sep 17 00:00:00 2001 From: Flavio Castelli Date: Tue, 6 Jun 2023 11:51:37 +0200 Subject: [PATCH] Support building with Tinygo and target `wasi` Enable building using the tinygo compiler, together with the `wasi` target. This combination requires different handling compared to go >= 1.21 and the `wasip1` target. That's because Tinygo compiles using the GOOS set to `linux` and the `GOARCH` set to `wasi`. Signed-off-by: Flavio Castelli --- terminal_check_unix.go | 2 ++ terminal_check_wasi.go | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 terminal_check_wasi.go diff --git a/terminal_check_unix.go b/terminal_check_unix.go index 04748b8..c9aed26 100644 --- a/terminal_check_unix.go +++ b/terminal_check_unix.go @@ -1,5 +1,7 @@ +//go:build (linux || aix || zos) && !js && !wasi // +build linux aix zos // +build !js +// +build !wasi package logrus diff --git a/terminal_check_wasi.go b/terminal_check_wasi.go new file mode 100644 index 0000000..2822b21 --- /dev/null +++ b/terminal_check_wasi.go @@ -0,0 +1,8 @@ +//go:build wasi +// +build wasi + +package logrus + +func isTerminal(fd int) bool { + return false +}