Skip to content

Commit 78919e0

Browse files
committed
compiler/natives: Update filter API.
Depends on shurcooL/httpfs#4. Rewrite filter in terms of Keep rather than Skip to make the logic simpler and more readable.
1 parent 4aa9d89 commit 78919e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/natives/fs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ func importPathToDir(importPath string) string {
2121
}
2222

2323
// FS is a virtual filesystem that contains native packages.
24-
var FS = filter.New(
24+
var FS = filter.Keep(
2525
http.Dir(importPathToDir("github.com/gopherjs/gopherjs/compiler/natives")),
2626
func(path string, fi os.FileInfo) bool {
27-
return path != "/" && path != "/src" && !strings.HasPrefix(path, "/src/")
27+
return path == "/" || path == "/src" || strings.HasPrefix(path, "/src/")
2828
},
2929
)

0 commit comments

Comments
 (0)