Trabla: GO & intellijidea 2016: create and run GO project in intellij idea
This tutorial explains how to create first GO lang project in Intellij IDEA 2016.1 an run it ( on windows OS).
Solving:
1. Install Go lang 1.6 for Windows
https://codingtrabla.blogspot.com/2016/03/go-install-golang-on-windows.html
2. Install Go lang plugin for Intellij IDEA 2016.1,
detailed tutorial here:
https://codingtrabla.blogspot.com/2016/03/intellijidea-20161-install-intellij.html
3. Run intellij IDEA , click "Create New Project"
4. In "New Project" dialog windows click on "Go" and press "Next" button
5. Now we need to select Go SDK - press "Configure" button
6. In dialog "Select Home Directory for Go SDK" select directory where Go is installed,
and press "OK" button.
E.g. on my PC - C:\Go
7. If Go SDK is detected and all is ok - you will see it on screen - Go icon with version.
Press "Next" button.
8. Type project name e.g. GoHelloWorldProject and press "Finish" button.
9. Hooray, project created !!! Create new .go file
right mouse click on project -> "New" -> "Go File"
10. Type file name - "HelloWorld" and press "OK"
11. Now we see error message "GOPATH is empty" - we need to set "GOPATH"
12. Add GOPATH - same path as project source folder,
disable checkbox "Use GOPATHdefined in system environment"
and press "Ok" button.
13. Now we need to put some code into HelloWorld.go
and setup Run configuration -
https://codingtrabla.blogspot.com/2016/03/go-intellijidea-2016-run-go-project-in.html
No comments:
Post a Comment