From 6b46741b180e1a90bb9747da4308f98858db9914 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Thu, 21 Apr 2022 23:48:08 -0400 Subject: [PATCH] Fix the build on aix --- internal/filewatcher/term_aix.go | 9 +++++++++ internal/filewatcher/term_bsd.go | 1 + internal/filewatcher/term_unix.go | 4 ++-- internal/filewatcher/watch.go | 3 +++ internal/filewatcher/watch_unsupported.go | 18 ++++++++++++++++++ 5 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 internal/filewatcher/term_aix.go create mode 100644 internal/filewatcher/watch_unsupported.go diff --git a/internal/filewatcher/term_aix.go b/internal/filewatcher/term_aix.go new file mode 100644 index 00000000..ff3bf47a --- /dev/null +++ b/internal/filewatcher/term_aix.go @@ -0,0 +1,9 @@ +//go:build aix +// +build aix + +package filewatcher + +import "golang.org/x/sys/unix" + +const tcGet = unix.TCGETA +const tcSet = unix.TCSETA diff --git a/internal/filewatcher/term_bsd.go b/internal/filewatcher/term_bsd.go index 6d88a101..d4e314d2 100644 --- a/internal/filewatcher/term_bsd.go +++ b/internal/filewatcher/term_bsd.go @@ -1,3 +1,4 @@ +//go:build darwin || dragonfly || freebsd || netbsd || openbsd // +build darwin dragonfly freebsd netbsd openbsd package filewatcher diff --git a/internal/filewatcher/term_unix.go b/internal/filewatcher/term_unix.go index 14c8af63..b0c41f0a 100644 --- a/internal/filewatcher/term_unix.go +++ b/internal/filewatcher/term_unix.go @@ -1,5 +1,5 @@ -//go:build !windows -// +build !windows +//go:build !windows && !aix +// +build !windows,!aix package filewatcher diff --git a/internal/filewatcher/watch.go b/internal/filewatcher/watch.go index 13a8e23a..ce8be930 100644 --- a/internal/filewatcher/watch.go +++ b/internal/filewatcher/watch.go @@ -1,3 +1,6 @@ +//go:build !aix +// +build !aix + package filewatcher import ( diff --git a/internal/filewatcher/watch_unsupported.go b/internal/filewatcher/watch_unsupported.go new file mode 100644 index 00000000..0167a741 --- /dev/null +++ b/internal/filewatcher/watch_unsupported.go @@ -0,0 +1,18 @@ +//go:build aix +// +build aix + +package filewatcher + +import ( + "fmt" + "runtime" +) + +type Event struct { + PkgPath string + Debug bool +} + +func Watch(dirs []string, run func(Event) error) error { + return fmt.Errorf("file watching is not supported on %v/%v", runtime.GOOS, runtime.GOARCH) +}