Skip to content

Commit 0cf8d2e

Browse files
committed
internal/fetch: include goexperiment.jsonv2
For golang/go#71488 For golang/go#71845 Change-Id: Ib1b2fcbe5fede9a7c48207aee06a7659b0d49403 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/666935 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Jonathan Amsterdam <[email protected]> kokoro-CI: kokoro <[email protected]> Reviewed-by: Junyang Shao <[email protected]>
1 parent d876005 commit 0cf8d2e

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

internal/fetch/load.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ func matchingFiles(goos, goarch string, allFiles map[string][]byte) (matchedFile
418418
GOARCH: goarch,
419419
CgoEnabled: true,
420420
Compiler: build.Default.Compiler,
421-
BuildTags: []string{"goexperiment.synctest"},
421+
BuildTags: []string{"goexperiment.jsonv2", "goexperiment.synctest"},
422422
ReleaseTags: build.Default.ReleaseTags,
423423

424424
JoinPath: path.Join,

internal/fetch/load_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ func TestMatchingFiles(t *testing.T) {
2727
package synctest
2828
var X int
2929
`
30+
jsonv2Body := `
31+
//go:build goexperiment.jsonv2
32+
33+
package json
34+
var X int
35+
`
3036

3137
plainContents := map[string]string{
3238
"README.md": "THIS IS A README",
@@ -45,6 +51,11 @@ func TestMatchingFiles(t *testing.T) {
4551
"st.go": synctestBody,
4652
}
4753

54+
jsonv2Contents := map[string]string{
55+
"plain.go": plainGoBody,
56+
"json.go": jsonv2Body,
57+
}
58+
4859
for _, test := range []struct {
4960
name string
5061
goos, goarch string
@@ -95,6 +106,16 @@ func TestMatchingFiles(t *testing.T) {
95106
"st.go": []byte(synctestBody),
96107
},
97108
},
109+
{
110+
name: "jsonv2",
111+
goos: "linux",
112+
goarch: "amd64",
113+
contents: jsonv2Contents,
114+
want: map[string][]byte{
115+
"plain.go": []byte(plainGoBody),
116+
"json.go": []byte(jsonv2Body),
117+
},
118+
},
98119
} {
99120
t.Run(test.name, func(t *testing.T) {
100121
files := map[string][]byte{}

0 commit comments

Comments
 (0)