![]() I'll admit I didn't realise we were doing things that out of the ordinary. Which gives me the Linux and darwin compiled versions.įor running the project we simply use " go run -race main.go" So if I'm working in "main.go" I'd use a relative import of "./db", if I'm working in a different subdirectory then I'd import it using "./db" and I can use all of the methods required.Īs for the actual build commands - if I'm in the directory I just run the following: go build -o build/darwin/d_project env GOOS=linux GOARCH=amd64 go build -o build/linux/l_project a subdirectory called "db"), then I can simply import this relative to the file I am working in. ![]() If I then have sub-directories in a project (e.g. I can also import non-standard packages fine (e.g. "log", "testing", "fmt") absolutely fine. Regarding the import question I can still import from the $GOPATH (e.g. Rightly or wrongly, since we started working with Go (~6 months ago) we've always had our repositories outside and haven't had any issues. My projects are not under "$GOPATH/src", no. So, can you please describe your workflow in a bit more detail? Specifically, why don't you use Go modules/place project under GOPATH? We could change it to "Directory" to support non-typical setups, but we first need to be sure this will be useful to a lot of programmers. We use "File" for "Run kind" option by default for such cases as the simplest and the cheapest one (no need to compile possibly unrelated files in the whole directory). The active license can be observed in the Help Register dialog or Register link at the bottom of the product Welcome Screen (when there is no project open). In general case, we cannot detect what is a programmer's intention when he asks to run a test in such a non-typical setup. This is a valid setup, although a non-typical one ( ). Second, you have a project that is outside of GOPATH but doesn't use Go modules. I admit that this behavior is a non-intuitive one, we will address this here: We infer this option for each project setup separately. First of all, when a Run configuration is created automatically (when you press a Play button) from a template, GoLand can ignore the "Run kind" option.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |