Open gengjiawen opened 3 years ago
Is there any new syntax in Golang 1.17?
There are in 1.18. Bump :)
Already upgraded to Go 1.22
Thank you for contributing this!
@DanSnow it looks like you haven't published the 1.1.0 release to npm https://www.npmjs.com/package/astexplorer-go as 1.0.0 is latest there and in https://registry.yarnpkg.com/astexplorer-go/
Also Go 1.23 allows range over function and iterables.
For reference, this is where this package was added to astexplorer: https://github.com/fkling/astexplorer/pull/459
Hi @StevenACoffman,
Thanks for reminding me. I have upgraded the go version to 1.23 and released the 1.1.0. Would you like to test it and create a PR on the astexplorer side?
Done! https://github.com/fkling/astexplorer/pull/727
Thanks so much!
@DanSnow Using https://github.com/fkling/astexplorer/pull/727, when I try to run astexplorer locally I get an error:
ERROR in ./node_modules/astexplorer-go/parser.wasm
Module not found: Error: Can't resolve 'gojs' in '/Users/steve/Documents/git/astexplorer/website/node_modules/astexplorer-go'
@ ./node_modules/astexplorer-go/parser.wasm
@ ./node_modules/astexplorer-go/index.js
@ ./src/parsers/go/go.js
@ ./src/parsers sync ^\.\/(?!utils|transpilers)[^/]+\/(transformers\/([^/]+)\/)?(codeExample\.txt|[^/]+?\.js)$
@ ./src/parsers/index.js
@ ./src/storage/parse.js
@ ./src/app.js
This is using Node 16 (since that is still max version supported for astexplorer). Steps to reproduce:
git clone git@github.com:StevenACoffman/astexplorer.git
cd astexplorer/website
yarn install
yarn build
It looks like when you changed the wasm_exec.js you didn't add the new https://github.com/golang/go/blob/go1.23.3/misc/wasm/wasm_exec_node.js file from when they split those into two files.
Dropping the wasm_exec_node.js file into my local astexplorer/website/node_modules/ doesn't fix it though. I'm not sure if index.js
or go.js
need to be updated, or the parser.wasm needs to be rebuilt or what.
BTW the Go 1.23.3 uses an identical https://github.com/golang/go/blob/go1.23.3/misc/wasm/wasm_exec.js as your current (and it looks like it's moving for Go 1.24 to https://github.com/golang/go/blob/master/lib/wasm/wasm_exec.js anyway)
RT