Justin Clift | 9f2f198 | 2018-09-04 15:43:15 +0100 | [diff] [blame] | 1 | ### [← Back](https://github.com/golang/go/wiki/WebAssembly) to the main WebAssembly page. |
| 2 | |
Justin Clift | 32cc8e4 | 2018-09-04 11:05:21 +0100 | [diff] [blame] | 3 | # Configuring GoLand for WebAssembly (Wasm) projects |
| 4 | |
| 5 | ## Initial project configuration |
Justin Clift | 123cd06 | 2018-09-04 02:07:36 +0100 | [diff] [blame] | 6 | |
| 7 | When you first open or start a WebAssembly project in GoLand, it won't understand the "*syscall/js*" package. |
| 8 | |
| 9 | That's easily fixable, by changing the **GOOS** and **GOARCH** values in the project settings, as per the screenshots below. |
| 10 | |
Justin Clift | e246597 | 2019-01-20 18:57:58 +1100 | [diff] [blame] | 11 |  |
Justin Clift | 123cd06 | 2018-09-04 02:07:36 +0100 | [diff] [blame] | 12 | |
Justin Clift | 819bce5 | 2018-09-05 10:16:51 +0100 | [diff] [blame] | 13 | **Note** - The screenshot below shows how to access **Settings** on a Linux desktop. If you're using macOS, you'll probably need to access them through the standard macOS **Preferences** option. |
Justin Clift | e246597 | 2019-01-20 18:57:58 +1100 | [diff] [blame] | 14 |  |
Justin Clift | 123cd06 | 2018-09-04 02:07:36 +0100 | [diff] [blame] | 15 | |
Justin Clift | e246597 | 2019-01-20 18:57:58 +1100 | [diff] [blame] | 16 |  |
Justin Clift | 123cd06 | 2018-09-04 02:07:36 +0100 | [diff] [blame] | 17 | |
Justin Clift | e246597 | 2019-01-20 18:57:58 +1100 | [diff] [blame] | 18 |  |
Justin Clift | 32cc8e4 | 2018-09-04 11:05:21 +0100 | [diff] [blame] | 19 | |
| 20 | |
Justin Clift | 0a7edf4 | 2018-09-04 12:02:00 +0100 | [diff] [blame] | 21 | ## Configuring Run/Debug settings |
Justin Clift | 32cc8e4 | 2018-09-04 11:05:21 +0100 | [diff] [blame] | 22 | |
Justin Clift | 0a7edf4 | 2018-09-04 12:02:00 +0100 | [diff] [blame] | 23 | With the initial project settings changed, you'll probably want to configure the Run/Debug settings next. |
| 24 | |
Justin Clift | 3ad5810 | 2018-09-04 12:36:39 +0100 | [diff] [blame] | 25 | That will let you recompile the .wasm file by just launching `Run` (<kbd>Shift</kbd>+<kbd>F10</kbd> on Linux). |
Justin Clift | 32cc8e4 | 2018-09-04 11:05:21 +0100 | [diff] [blame] | 26 | |
Justin Clift | e246597 | 2019-01-20 18:57:58 +1100 | [diff] [blame] | 27 |  |
Justin Clift | 32cc8e4 | 2018-09-04 11:05:21 +0100 | [diff] [blame] | 28 | |
Justin Clift | e246597 | 2019-01-20 18:57:58 +1100 | [diff] [blame] | 29 |  |
Justin Clift | 32cc8e4 | 2018-09-04 11:05:21 +0100 | [diff] [blame] | 30 | |
Justin Clift | e246597 | 2019-01-20 18:57:58 +1100 | [diff] [blame] | 31 |  |
Justin Clift | 32cc8e4 | 2018-09-04 11:05:21 +0100 | [diff] [blame] | 32 | |
Justin Clift | e246597 | 2019-01-20 18:57:58 +1100 | [diff] [blame] | 33 |  |
Justin Clift | 32cc8e4 | 2018-09-04 11:05:21 +0100 | [diff] [blame] | 34 | |
Justin Clift | e246597 | 2019-01-20 18:57:58 +1100 | [diff] [blame] | 35 |  |
Justin Clift | 32cc8e4 | 2018-09-04 11:05:21 +0100 | [diff] [blame] | 36 | |
Justin Clift | e246597 | 2019-01-20 18:57:58 +1100 | [diff] [blame] | 37 |  |
Justin Clift | 32cc8e4 | 2018-09-04 11:05:21 +0100 | [diff] [blame] | 38 | |
Justin Clift | e246597 | 2019-01-20 18:57:58 +1100 | [diff] [blame] | 39 |  |
Justin Clift | 32cc8e4 | 2018-09-04 11:05:21 +0100 | [diff] [blame] | 40 | |
Justin Clift | e246597 | 2019-01-20 18:57:58 +1100 | [diff] [blame] | 41 |  |
Justin Clift | 32cc8e4 | 2018-09-04 11:05:21 +0100 | [diff] [blame] | 42 | |
Justin Clift | e246597 | 2019-01-20 18:57:58 +1100 | [diff] [blame] | 43 |  |
Justin Clift | 32cc8e4 | 2018-09-04 11:05:21 +0100 | [diff] [blame] | 44 | |
Justin Clift | e246597 | 2019-01-20 18:57:58 +1100 | [diff] [blame] | 45 |  |
Justin Clift | 32cc8e4 | 2018-09-04 11:05:21 +0100 | [diff] [blame] | 46 | |
Justin Clift | e246597 | 2019-01-20 18:57:58 +1100 | [diff] [blame] | 47 |  |
Justin Clift | e5dde77 | 2018-09-04 15:36:06 +0100 | [diff] [blame] | 48 | |
Justin Clift | 9f2f198 | 2018-09-04 15:43:15 +0100 | [diff] [blame] | 49 | Finished, your GoLand setup should now be complete. |
| 50 | |
| 51 | ### [← Back](https://github.com/golang/go/wiki/WebAssembly) to the main WebAssembly page. |