You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
// This calls a JS function from Go.funcmain() {
println("adding two numbers:", add(2, 3)) // expecting 5
}
// This function is imported from JavaScript, as it doesn't define a body.// You should define a function named 'add' in the WebAssembly 'env'// module from JavaScript.////export addfuncadd(x, yint) int// This function is exported to JavaScript, so can be called using// exports.multiply() in JavaScript.////export multiplyfuncmultiply(x, yint) int {
returnx*y
}
// Providing the environment object, used in WebAssembly.instantiateStreaming.// This part goes after "const go = new Go();" declaration.go.importObject.env={'add': function(x,y){returnx+y}// ... other functions}// Calling the multiply function:console.log('multiplied two numbers:',wasm.exports.multiply(5,3));
Build
GOOS=js GOARCH=wasm tinygo build -o wasm.wasm ./main.go
could not parse Go version: version does not start with 'go' prefix
I want to know the way how to avoid this error. Who knows tips ?
Or, ideally, if the devel string is skipped, this error will be solved.
At least, Go version can't be modified, so the aggressive parsing is valuable for me or someone (maybe). But I'm not familiar with TinyGo, so I want to know the mainter's opinion.
How about ?
go env -w GOVERSION='1.22'
go: GOVERSION cannot be modified
The text was updated successfully, but these errors were encountered:
Go version
TinyGo version
Source codes
I attempted to run these.
ref. https://tinygo.org/docs/guides/webassembly/wasm/
Build
This error occurs at this line.
I want to know the way how to avoid this error. Who knows tips ?
Or, ideally, if the
devel
string is skipped, this error will be solved.At least, Go version can't be modified, so the aggressive parsing is valuable for me or someone (maybe). But I'm not familiar with TinyGo, so I want to know the mainter's opinion.
How about ?
The text was updated successfully, but these errors were encountered: