Skip to content

Commit d422bb4

Browse files
committed
compiler/gopherjspkg: explicitly mention the vfsgen dependency
The natives package has a blank import of the vfsgen package so that it stays included in go.mod (otherwise go mod tidy considers it as unused and removes it). Copy that mechanism here. Place it under a file with a "generate" build constraint so it doesn't get included in a normal gopherjs build, since it's only needed during code generation.
1 parent 42157da commit d422bb4

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

compiler/gopherjspkg/doc.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
// operation. They are needed to build the Go standard library with GopherJS.
55
// Currently, they include:
66
//
7-
// github.com/gopherjs/gopherjs/js
8-
// github.com/gopherjs/gopherjs/nosync
9-
//
7+
// github.com/gopherjs/gopherjs/js
8+
// github.com/gopherjs/gopherjs/nosync
109
package gopherjspkg
11-
12-
//go:generate vfsgendev -source="github.com/gopherjs/gopherjs/compiler/gopherjspkg".FS -tag=gopherjsdev
13-
//go:generate gofmt -w -s fs_vfsdata.go

compiler/gopherjspkg/gen.go

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//go:build generate
2+
// +build generate
3+
4+
package gopherjspkg
5+
6+
import (
7+
_ "github.com/shurcooL/vfsgen" // Force go.mod to require this package.
8+
)
9+
10+
//go:generate vfsgendev -source="github.com/gopherjs/gopherjs/compiler/gopherjspkg".FS -tag=gopherjsdev
11+
//go:generate gofmt -w -s fs_vfsdata.go

0 commit comments

Comments
 (0)