Configuring VSCode to Use Build Tags in GoLang to Separate Integration and Unit Test Code

One of the ways to separate unit and integration test code in golang is to use build tags.

A TLDR; on build tags is that it is a way to tell the compiler which source code to include or ignore when doing a build.

For example: if we have the following golang code:

// +build integration

package integration

import "testing"

func TestSomething(t *testing.T) {
	// Some test code
}

Then this code will only be compiled if we run the → Continue reading “Configuring VSCode to Use Build Tags in GoLang to Separate Integration and Unit Test Code”