What is proper way to import (use) go module internally?
For example:
creating a new module by: go mod init example.com/my-project (example.com or another domain, which doesn't exist)
and using it in the same project:
import (
…
After I updated GoLand from EAP 18 to EAP 19 my imports are red and these errors occur in each file:
My $GOROOT and $GOPATH are the same as before. $GOROOT points to /usr/local/go. Files are buildable through shell but GoLand keep showing errors.
I…
How to run git log -G my-search-term in JetBrains IDEs?
Of course I know how to run this command in the terminal of the IDE,
but it would be great if I could use the git-integration, and the nice native
GUI to browser the results (commits) of above…
I built my .so file:
go build -buildmode=plugin -o test.so
and run debug with Goland, then I get the error:
Error running agent: could not initialize input inputs.plugin_input: plugin.Open("./plugins_lib/test1"): plugin was built with a different…
I am trying to run Go application with IDE GoLand by JetBrains. I just want to run the following command like this:
$ go run main.go service.go
Could you tell me how to configure at "Edit Configuration" panel? I tried to set "Program arguments" but…
When I create a project, I forgot to check [index entire GOPATH]. So currently, the project can't find third party modules.
Even though I checked [index entire GOPATH] option for this project in Preferences | Go | GOPATH | Project GOPATH, the…
I am using VSCODE and it has a shortcut where it displays in a popup the interfaces, functions in the file. It is fairly common to have functions in a file in Goland without any encapsulation in interface. When I press Ctrl+F12 in Goland, it does…
Im having a Golang code which I create from it binary for mac via go build
like:
build darwin amd64 myapp
Currently Im able to run the binary and see the logs.
Now I want to debug it , is there a way to debug the binary with Goland or Intellij or…
I am trying to setup GoLand correctly to be able to use it with Go.
I'm trying to run the follow simple HelloWorld go project.
package HelloWorldProject
import "fmt"
func main(){
fmt.Printf("Hello")
fmt.Printf("1+1 = ", 1+1)
}
This is…
I press Run button to start my program work then I press button Start CPU Usage Profiling. At the end I get a file like GO-version_username_time.zip.
What should I do next? How can I get a list of most expensive functions?
I have a function as below, I have tried mocking the aws s3 selectobjectcontentoutput but all in vain. I have even tried s3fice which says: Package s3iface provides an interface to enable mocking the Amazon Simple Storage Service service client for…
Is there a way to check if a public function/struct is used outside of the package in which it's declared? I'm not writing a public go module that's consumed anywhere else, and simply want to scan whether func Foo() it's used anywhere in my codebase…
In Goland (2022.1.3), using go (1.19.1), it can't resolve os.Remove(), but if I change to os.RemoveAll(), it's ok.
I've checked go doc and source code, the function does exists.
So, what's wrong ? Is that a goland bug ?
(BTW, I'm using linux os, if…
I am getting an error whereby any imports defined in the Go.Mod file are not being resolved. An error message stating "go list -m json all (pkgserver.com) Failed to Run" is displayed. This includes imports from our own server, and github.
In the…
Let's say I've got the following structs:
type A struct {
Field1 string
Field2 string
}
type B struct {
Field3 string
Field4 int
}
and one more struct which uses the previous two:
type C struct {
A
MyList []B
}
Now, I've…