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
+7.9k Golang : Routes multiplexer routing example with regular expression control
+18.9k Golang : Populate dropdown with html/template example
+11.3k Golang : Simple file scaning and remove virus example
+26k Golang : Get executable name behind process ID example
+9.1k Golang : How to protect your source code from client, hosting company or hacker?
+21.5k Golang : Setting up/configure AWS credentials with official aws-sdk-go
+14.2k Golang : How to determine if user agent is a mobile device example
+41.2k Golang : Convert string to array/slice
+5.9k Golang : Measure execution time for a function
+5.1k Unix/Linux/MacOSx : How to remove an environment variable ?
+9.1k Golang : Detect Pascal, Kebab, Screaming Snake and Camel cases
+10.7k Golang : Create Temporary File