File tree 2 files changed +34
-2
lines changed
2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -17,16 +17,18 @@ func WasmExecJSURL(goVersion string) (string, error) {
17
17
if len (m ) == 0 {
18
18
return "" , fmt .Errorf ("wasmserveutil: invalid Go version: %s" , goVersion )
19
19
}
20
+
21
+ major , _ := strconv .Atoi (m [1 ])
20
22
minor , _ := strconv .Atoi (m [2 ])
21
23
22
24
// go.mod might have a version without `.0` like `go1.22`. This version might not work as a part of URL.
23
- if minor >= 22 && m [3 ] == "" {
25
+ if ( major > 1 || minor >= 22 ) && m [3 ] == "" {
24
26
goVersion += ".0"
25
27
}
26
28
27
29
// The directory name was changed from `misc` to `lib` at Go 1.24.
28
30
dir := "lib"
29
- if minor <= 23 {
31
+ if major == 1 && minor <= 23 {
30
32
dir = "misc"
31
33
}
32
34
Original file line number Diff line number Diff line change @@ -75,6 +75,36 @@ func TestWasmExecJSURL(t *testing.T) {
75
75
url : "https://go.googlesource.com/go/+/refs/tags/go1.24.1/lib/wasm/wasm_exec.js?format=TEXT" ,
76
76
error : false ,
77
77
},
78
+ {
79
+ goVersion : "go2.23" ,
80
+ url : "https://go.googlesource.com/go/+/refs/tags/go2.23.0/lib/wasm/wasm_exec.js?format=TEXT" ,
81
+ error : false ,
82
+ },
83
+ {
84
+ goVersion : "go2.23.0" ,
85
+ url : "https://go.googlesource.com/go/+/refs/tags/go2.23.0/lib/wasm/wasm_exec.js?format=TEXT" ,
86
+ error : false ,
87
+ },
88
+ {
89
+ goVersion : "go2.23.1" ,
90
+ url : "https://go.googlesource.com/go/+/refs/tags/go2.23.1/lib/wasm/wasm_exec.js?format=TEXT" ,
91
+ error : false ,
92
+ },
93
+ {
94
+ goVersion : "go2.24" ,
95
+ url : "https://go.googlesource.com/go/+/refs/tags/go2.24.0/lib/wasm/wasm_exec.js?format=TEXT" ,
96
+ error : false ,
97
+ },
98
+ {
99
+ goVersion : "go2.24.0" ,
100
+ url : "https://go.googlesource.com/go/+/refs/tags/go2.24.0/lib/wasm/wasm_exec.js?format=TEXT" ,
101
+ error : false ,
102
+ },
103
+ {
104
+ goVersion : "go2.24.1" ,
105
+ url : "https://go.googlesource.com/go/+/refs/tags/go2.24.1/lib/wasm/wasm_exec.js?format=TEXT" ,
106
+ error : false ,
107
+ },
78
108
}
79
109
80
110
for _ , tc := range testCases {
You can’t perform that action at this time.
0 commit comments