Skip to content

Tutorial and example of IntelliJ Goland setup for Golang 1.11+ for Go modules

Notifications You must be signed in to change notification settings

BulderKristian/golang-goland-setup-guide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Setup guide for Goland

Golang 1.11+ Go modules

Installation

For installing Goland or any other of the Jetbrains tools I recommend using the Jetbrains Toolbox. Link This makes installing and updating Goland a trivial matter and is available for free

Configuration

Setting

Once you have started Goland.

  1. Click 'configure' button in the lower right corner
  2. Click 'settings'
  3. Click 'Go' on the top
  4. Click 'Go Modules (vgo)'
  5. Check 'Enable Go Modules (vgo) integration'
  6. Apply and Exit settings

Usage

Once you have created your golang-project

  1. Open a terminal
  2. Write go mod init github.com/<username>/<repository>
  3. Create main.go
  4. Create src/yourmodule/yourmodule.go
  5. Remember to capitalize the functions and types that you want exported from the class
  6. Use the function in main.go and save
  7. Goland should now have automatically added an import statement for your new function
  8. Run the program by either
    • Right-clicking on main.go -> 'run go build main.go'
    • Writing go build main.go && ./main

Example of finished structure

.
├── src
|   └── yourmodule
|   	└── yourmodule.go
└── mod.go
└── main.go

About

Tutorial and example of IntelliJ Goland setup for Golang 1.11+ for Go modules

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages