Skip to content

Commit

Permalink
Don't build on appengine
Browse files Browse the repository at this point in the history
AppEngine forbids usage of the unsafe package,

Fixes #534
Fixes spf13/viper#538
  • Loading branch information
arp242 committed Nov 4, 2022
1 parent 0cb9c88 commit 7ed195f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions backend_inotify.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build linux
// +build linux
//go:build linux && !appengine
// +build linux,!appengine

package fsnotify

Expand Down
15 changes: 5 additions & 10 deletions backend_other.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
//go:build !darwin && !dragonfly && !freebsd && !openbsd && !linux && !netbsd && !solaris && !windows
// +build !darwin,!dragonfly,!freebsd,!openbsd,!linux,!netbsd,!solaris,!windows
//go:build appengine || (!darwin && !dragonfly && !freebsd && !openbsd && !linux && !netbsd && !solaris && !windows)
// +build appengine !darwin,!dragonfly,!freebsd,!openbsd,!linux,!netbsd,!solaris,!windows

package fsnotify

import (
"fmt"
"runtime"
)
import "errors"

// Watcher watches a set of paths, delivering events on a channel.
//
Expand Down Expand Up @@ -107,7 +104,7 @@ type Watcher struct {

// NewWatcher creates a new Watcher.
func NewWatcher() (*Watcher, error) {
return nil, fmt.Errorf("fsnotify not supported on %s", runtime.GOOS)
return nil, errors.New("fsnotify not supported on the current platform")
}

// Close removes all watches and closes the events channel.
Expand Down Expand Up @@ -161,9 +158,7 @@ func (w *Watcher) Add(name string) error { return nil }
//
// - [WithBufferSize] sets the buffer size for the Windows backend; no-op on
// other platforms. The default is 64K (65536 bytes).
func (w *Watcher) AddWith(name string, opts ...addOpt) error {
return nil
}
func (w *Watcher) AddWith(name string, opts ...addOpt) error { return nil }

// Remove stops monitoring the path for changes.
//
Expand Down

0 comments on commit 7ed195f

Please sign in to comment.