![]() For a more comprehensive overview of the differences between Go Modules and the $GOPATH, consider reading this official blog post from the Go core team. Go Modules are intended to replace the $GOPATH and became the default option starting with Go version 1.13. Note: This tutorial uses Go Modules, which is a package management system introduced in Go version 1.11. On macOS, you can also install Go using the Homebrew package manager. You can follow these instructions to install Go on Linux, macOS and Windows. Go Version 1.11 or higher installed on your local machine. Visit our tutorial series/ebook, How To Code in Go, for a broad introduction to the language. ![]() To complete this tutorial, you’ll need the following:Ī familiarity with the Go programming language. Once you complete the tutorial, you will have a working unit-testing suite that includes a table-based unit test, a coverage test, a benchmark, and a documented example. In this tutorial, you will create a small program and then run a series of tests on your code using Go’s testing package and the go test command. The job of unit tests is to check the correctness of an application, and they are a crucial part of the Go programming language. IntroductionĪ unit test is a function that tests a specific piece of code from a program or package. The author selected the FreeBSD Foundation to receive a donation as part of the Write for DOnations program.
0 Comments
Leave a Reply. |