Skip to content

Commit

Permalink
Guard unsafe imports behind !appengine
Browse files Browse the repository at this point in the history
"unsafe" (in this case, imported via "golang.org/x/sys/unix") cannot be
used on AppEngine, so we need to add the "!appengine" build constraint
to files that use it (namely a few terminal_check_*.go).

Fixes sirupsen#947.
  • Loading branch information
Hexcles committed Apr 11, 2019
1 parent 9b3cdde commit a0dcfa3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion terminal_check_bsd.go
@@ -1,4 +1,5 @@
// +build darwin dragonfly freebsd netbsd openbsd
// +build !appengine

package logrus

Expand All @@ -10,4 +11,3 @@ func isTerminal(fd int) bool {
_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
return err == nil
}

3 changes: 3 additions & 0 deletions terminal_check_solaris.go
@@ -1,3 +1,6 @@
// +build solaris
// +build !appengine

package logrus

import (
Expand Down
2 changes: 1 addition & 1 deletion terminal_check_unix.go
@@ -1,4 +1,5 @@
// +build linux aix
// +build !appengine

package logrus

Expand All @@ -10,4 +11,3 @@ func isTerminal(fd int) bool {
_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
return err == nil
}

2 changes: 1 addition & 1 deletion terminal_check_windows.go
@@ -1,4 +1,4 @@
// +build !appengine,!js,windows
// +build windows

package logrus

Expand Down

0 comments on commit a0dcfa3

Please sign in to comment.