File tree 3 files changed +9
-4
lines changed
3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package build
3
3
import (
4
4
"fmt"
5
5
"go/build"
6
+ "net/http"
6
7
"path/filepath"
7
8
"strings"
8
9
"testing"
@@ -13,6 +14,10 @@ import (
13
14
"golang.org/x/tools/go/buildutil"
14
15
)
15
16
17
+ func init () {
18
+ gopherjspkg .RegisterFS (http .Dir (".." ))
19
+ }
20
+
16
21
func TestSimpleCtx (t * testing.T ) {
17
22
e := DefaultEnv ()
18
23
Original file line number Diff line number Diff line change 1
1
package gopherjspkg
2
2
3
3
import (
4
- "io/fs"
5
4
"net/http"
6
5
)
7
6
8
7
// FS is a virtual filesystem that contains core GopherJS packages.
9
8
var FS http.FileSystem
10
9
11
10
// 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
14
13
}
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ package main
9
9
10
10
import (
11
11
"embed"
12
+ "net/http"
12
13
13
14
"github.com/gopherjs/gopherjs/compiler/gopherjspkg"
14
15
)
@@ -17,5 +18,5 @@ import (
17
18
var fs embed.FS
18
19
19
20
func init () {
20
- gopherjspkg .RegisterFS (fs )
21
+ gopherjspkg .RegisterFS (http . FS ( fs ) )
21
22
}
You can’t perform that action at this time.
0 commit comments