Questions tagged [goland]

GoLand is an IDE by JetBrains for the Go programming language

Links:

  1. Official Site
  2. Documentation Pages
  3. Download Page
  4. The GoLand Blog
538 questions
4
votes
2 answers

Why /user/local/go isn't recognized as a Go SDK in GoLand

I'm trying to setup GoLand to use WSL 2 as in this guide: https://www.jetbrains.com/help/go/how-to-use-wsl-development-environment-in-product.html I've installed Go in the Ubuntu distro following the linux instructions on the GoLang website, and go…
GridDragon
  • 2,857
  • 2
  • 33
  • 41
4
votes
2 answers

GoLand No Tests Were Run

I have a method that I am testing, and everything seems fine. However, when I run the tests in GoLand, I can see in the output that the tests "PASS" but the test runner says "no tests were run". Here's the sample method in calculator.go package…
4
votes
2 answers

After go install the import doesn't recognize the package

Hi I'm pretty new at Golang, after install it I would like to use the next package in my project: https://github.com/gin-gonic/gin After I created my project, I did the next command to install gingonic: go get -u github.com/gin-gonic/gin But the…
rasilvap
  • 1,771
  • 3
  • 31
  • 70
4
votes
1 answer

Cannot set breakpoint in golang packages in Intellij 2020.1

I have a simple web app which has cmd/ and pkg/ folders. As a convention, I'm importing packages in *.go files in cmd folder. Setting breakpoints work fine in any file in cmd but it doesn't work in packages. Error message is: could not find…
baqx0r
  • 105
  • 1
  • 2
  • 11
4
votes
0 answers

Correct way to import files in the same project in Go

I have a Go project with a structure like this: cmd myapp main.go internal app myapp impl.go Now in main.go, I want to import impl.go. GoLand tells me that I should do it like this: import ( …
flyx
  • 35,506
  • 7
  • 89
  • 126
4
votes
1 answer

scanner.Scan() hangs in GoLand debugger

Using Go v1.11.1 on OSX Mojava with GoLand 2018.3. When I run the following program in normal mode (not via debugger), it works fine. When I run it with the debugger, it hangs in the scanner.Scan() call. package main import ( "bufio" …
kg_sYy
  • 1,127
  • 9
  • 26
4
votes
3 answers

Automatically import 3rd party go packages

I was wondering if there is a way to automatically download all the imports. So let's assume I need to use github.com/gorilla/mux and several other packages in my code base. Should I manually go to my ~/go/src and run go get repo or is there a…
Achilleus
  • 1,824
  • 3
  • 20
  • 40
4
votes
2 answers

Intellij IDEA. Check syntax for files without extension

I have Jenkinsfile it's written in Groovy, but file name doesn't have approprite extension: .groovy. How can I tell IDEA to check groovy syntax of this file? Update: Also I interested in the same question about GoLand IDE
Rudziankoŭ
  • 10,681
  • 20
  • 92
  • 192
4
votes
3 answers

Default file watchers in Goland

Is there a way to enable certain file watchers by default in all projects? It bugs me that I have to do this manually, but I've not found an option. For example, I like to enable the goimports file watcher for every project in Goland.
Duncan Jones
  • 67,400
  • 29
  • 193
  • 254
4
votes
1 answer

Shortcut to install libraries in Goland

I'm following the instructions in https://golang.org/doc/code.html#Library and trying to use Goland. I'm surprised though that I can't find a fast way to install the library I'm writing. According to the tutorial, you should use install to install…
uzilan
  • 2,554
  • 2
  • 31
  • 46
4
votes
5 answers

How to inspect global variables in GoLand when debugging a golang program?

When I debug a go program in GoLand, I can't see the value of global variable. Can anyone tell me why and how to fix it? Here is an example: I set a breakpoint in the last line of main function. But as shown in the picture, we can only get the value…
hc ch
  • 137
  • 1
  • 7
4
votes
2 answers

How to only build, not run

In GoLand, how do I set up a Run/Debug Configuration to only build a project go build and not run it go run *.go. The Getting Started guide says The Go Application type is equal to go build command - but it actually runs my binary. The Features page…
Sonia Hamilton
  • 4,229
  • 5
  • 35
  • 50
4
votes
1 answer

In Gogland I get 'flag provided but not defined: -goversion' using go run

I am trying to run my go script called release.go in the Goglang built in terminal and it gives me the following output $ go run release.go # command-line-arguments flag provided but not defined: -goversion usage: compile [options] file.go... -% …
Uberswe
  • 1,038
  • 2
  • 16
  • 36
4
votes
1 answer

Some tips with Go and Gogland

Hi all. I'm very new with Go and Gogland. I have a project I choose "Run kind" as Package - to run not only main file but a project. Why it cannot find main package?? How to import util.myprinter package to main.go to use it?? Please, help me
trashgenerator
  • 460
  • 7
  • 22
4
votes
3 answers

How to run/debug a beego app using Gogland (go language)

Im using Gogland (IDE from JetBrains. Version 1.0 Preview/EAP Feb, 10 2017) to create a Beego web app. I can run it from command line with: bee run and everything works. However if I run it from the IDE with the following configuration when I…
rafahoro
  • 1,237
  • 13
  • 19