How to Write Go Code Introduction Code organization GOPATH and workspaces Import paths Package names Building and installing Building a package Building a command Testing Remote packages Further reading Introduction This document demonstrates the development of a simple Go package and introduces the go command , the standard way to fetch, build, and install Go packages and commands. Code organization GOPATH and workspaces One of Go's design goals is to make writing software easier. To that end, the go command doesn't use Makefiles or other configuration files to guide program construction. Instead, it uses the source code to find dependencies and determine build conditions. This means your source code and build scripts are always in sync; they are one and the same. The one thing you must do is set a GOPATH environment variable. GOPATH tells the go command (and other related tools) where to find...
Comments
Post a Comment