![goland build tags goland build tags](https://www.phillipsj.net/images/staticcheck-goland/settings-tools-dialog.png)
This post explains how conditional compilation is implemented and show you how you can use it in your projects. Instead a system of tags and naming convention defined in the go/build package and supported by the go tool allows Go packages to customise themselves for the specific platform they are being compiled for. Go does not have a preprocessor, a macro system, or a #define declaration to control the inclusion of platform specific code. When developing Go packages that rely on specific features of the underlying platform or processor it is often necessary to provide a specialised implementation.
![goland build tags goland build tags](https://www.phillipsj.net/images/staticcheck-goland/file-watchers-dialog.png)
Now this section is pretty straight forward.
![goland build tags goland build tags](https://resources.jetbrains.com/help/img/idea/2021.3/go_support_automatic_vendoring_mode_earlier_versions.png)
Then you’d write your module packages specifically for that repo like you would normally) Creating the application example (Note: Now if you want to create 3rd party modules, you’d probably want to create it normally then rename the module (so it doesn’t create unnecessary long folder name like ‘z:\blah\\name’ gotta love vgo because of not needing to do that) to the repo path where it’s hosted like “/name/reponame”. This will create a go.mod file for you with the name of the module set for you. It’s very simple, load up goland, click New Project, select Go Module (vgo), make sure the project path is where you want your application to be stored and make sure the sdk (path to vgo is select, should be selected by default). Next lets create a new goland vgo project. (Note: You also still need GOPATH to be set for packages to be cached else they will be stored in your user folder, so set a user environment variable for GOPATH to the path where you want your cache to be stored)
#Goland build tags download#
First you should Download Golang 1.11 (latest) and make sure golang’s bin is set in your environment. So if you want to create a local application without the need of using a local repository to create an application which uses other peoples modules then this is the article you’ve been waiting for which is odd how simple it is to accomplish and yet there’s little to no information available online. I’ve come across a few stackoverflow questions and the best answer was this one even though it wasn’t fully answering my question.
#Goland build tags how to#
So I’ve been googling for a few weeks now trying to understand how to create a simple local application using vgo because it seemed fairly interesting to me.