From fe6fefc9b4bc184e9e8a9aadf7bb3f13bdcc8f3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Thu, 9 Jul 2020 19:08:50 +0100 Subject: [PATCH] log/term: fix build on GOOS=js GOARCH=wasm Before this fix, the build would fail, as IsTerminal isn't defined on that platform: $ GOOS=js GOARCH=wasm go build # github.com/go-kit/kit/log/term ./term.go:14:6: undefined: IsTerminal The reason is pretty simple; js/wasm doesn't have syscalls, and thus it doesn't have an "is a terminal" syscall. Grouping it with appengine to always assume that the output is not a terminal is good enough for now, as it at least makes the package build. No change is needed in any other file, because none of the other IsTerminal +build lines include js/wasm in any way. --- log/term/{terminal_appengine.go => terminal_stub.go} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename log/term/{terminal_appengine.go => terminal_stub.go} (93%) diff --git a/log/term/terminal_appengine.go b/log/term/terminal_stub.go similarity index 93% rename from log/term/terminal_appengine.go rename to log/term/terminal_stub.go index b023121ae..7c3e64b79 100644 --- a/log/term/terminal_appengine.go +++ b/log/term/terminal_stub.go @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build appengine +// +build appengine js package term