Skip to content

Commit 4c93b05

Browse files
committed
Work toward making tests pass
1 parent d4f201a commit 4c93b05

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

build/context_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package build
33
import (
44
"fmt"
55
"go/build"
6+
"net/http"
67
"path/filepath"
78
"strings"
89
"testing"
@@ -13,6 +14,10 @@ import (
1314
"golang.org/x/tools/go/buildutil"
1415
)
1516

17+
func init() {
18+
gopherjspkg.RegisterFS(http.Dir(".."))
19+
}
20+
1621
func TestSimpleCtx(t *testing.T) {
1722
e := DefaultEnv()
1823

compiler/gopherjspkg/fs.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
package gopherjspkg
22

33
import (
4-
"io/fs"
54
"net/http"
65
)
76

87
// FS is a virtual filesystem that contains core GopherJS packages.
98
var FS http.FileSystem
109

1110
// RegisterFS allows setting the embedded fs from another package.
12-
func RegisterFS(fs fs.ReadDirFS) {
13-
FS = http.FS(fs)
11+
func RegisterFS(fs http.FileSystem) {
12+
FS = fs
1413
}

embed.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package main
99

1010
import (
1111
"embed"
12+
"net/http"
1213

1314
"github.com/gopherjs/gopherjs/compiler/gopherjspkg"
1415
)
@@ -17,5 +18,5 @@ import (
1718
var fs embed.FS
1819

1920
func init() {
20-
gopherjspkg.RegisterFS(fs)
21+
gopherjspkg.RegisterFS(http.FS(fs))
2122
}

0 commit comments

Comments
 (0)