Gogland : Single File versus Go Application Run Configurations
This is a follow up from the previous guide on how to place the source code files in Gogland. Thanks to the valuable tip provided by dlsniper... apparently, there is a way to fix the - "wrong way"
- of placing your source code files with Gogland IDE.
Correcting the previous guide inaccuracy..... as a matter of fact.... you still can place your files together in the main directory and run the project.
See what I mean:
The difference is that in the previous guide, the default Run Configuration
is set to "Go Single File"
.
To allow your project to invoke function from files within the same directory, all you need to do is to alter the Run Configurations
to use "Go Application"
instead of "Go Single File"
For comparison purpose and to highlight the differences:
Top - Go Application
. Bottom - Go Single File
Hope this helps and if you do have question regarding Gogland IDE do raise it up at https://youtrack.jetbrains.com/issues/Go or reach out to dlsniper
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+9.3k Golang : Launch Mac OS X Preview (or other OS) application from your program example
+8.7k Android Studio : Image button and button example
+9.9k Golang : Get escape characters \u form from unicode characters
+20.5k Golang : Secure(TLS) connection between server and client
+21.1k Golang : How to force compile or remove object files first before rebuild?
+21.5k Golang : GORM create record or insert new record into database example
+11.6k Golang : Convert(cast) float to int
+37.1k Golang : Converting a negative number to positive number
+14.4k Golang : How to filter a map's elements for faster lookup
+6.9k Golang : How to setup a disk space used monitoring service with Telegram bot
+19.3k Golang : Fix cannot download, $GOPATH not set error
+7.4k Golang : Gorrila set route name and get the current route name