WebAssembly (Wasm) is a binary code that you can run in a browser. GoLand supports generation of WASM files from GO files. You can read more about You can read more about WebAssembly in documentation at webassembly.org.
Open settings Ctrl+Alt+S, and navigate to.
From the OS list, select js.
From the Arch list, select wasm.
Click Add configuration on the main toolbar.
Click Add New Configuration icon or press Alt+Insert.
In the Files field, add the name of the GO file that you want to execute (for example,
Clear the Run after build checkbox.
In the Environment field, click the folder icon ().
In the Environment Variables dialog, add two environment variables:
In the Go tool arguments field, replace the
-o main.wasm, where
main.wasmis the name of the future WASM file.
Click the Run <configuration_name > icon or pressShift+F10. As the result, in the Project tool window a new WASM file is created.