You're reading <proj-root>/README.md
.
Download the tarball go1.11rc1.<os>-<arch>.tar.gz
, e.g. go1.11rc1.linux-amd64.tar.gz
, from https://golang.org/dl/ (if not accessible for you, try this mirror page instead) with prebuilt go
binary included, then untar it as "$HOME/go1.11rc1.linux-amd64/"(bash-shell)
or "$env:USERPROFILE\go1.11rc1.windows-amd64\"(powershell)
, and configure the environment-variables $GOROOT
, $PATH
and $GOPATH
appropriately, e.g.
# The path of this file is usually "$HOME/.bash_profile".
export GOROOT=$HOME/go1.11rc1.linux-amd64/go
export PATH=$PATH:$GOROOT/bin
export GOPATH=$HOME/go # Use "mkdir -p" to create if it doesn't exist yet.
for a bash-shell or
# The path of this file is "$PROFILE".
$env:GOROOT="$env:USERPROFILE\go1.11rc1.windows-amd64\go"
$env:PATH="$env:PATH;$env:GOROOT\bin"
$env:GOPATH="$env:USERPROFILE\go" # Use "mkdir -p" to create if it doesn't exist yet.
for a powershell.
shell> go tool tour
shell> godoc -http=:6060
Visit http://localhost:6060 and wander around.
If you're using Windows, please make sure that godoc
is launched from powershell or the old command-prompt.
- The
<proj-root>/go.mod
file was automatically generated by
proj-root> go mod init mycompany.org/thisproj
- The
<proj-root>/go.mod
file was then automatically updated and the<proj-root>/go.sum
file was automatically generated as well by
proj-root> go get github.com/kardianos/vtest
- The
<proj-root>
here is defined as modulemycompany.org/thisproj
in<proj-root>/go.mod
.- You can use arbitrary module name, e.g. either a more cascaded one like "myproj" or a shorter one like "mycompany.org/genxium/2018/august/go111/moduleprac" instead of "mycompany.org/thisproj". Such change will require corresponding updates for the
import
statement in<proj-root>/main.go
.
- You can use arbitrary module name, e.g. either a more cascaded one like "myproj" or a shorter one like "mycompany.org/genxium/2018/august/go111/moduleprac" instead of "mycompany.org/thisproj". Such change will require corresponding updates for the
- The package
<proj-root>/arithmetic
is thus imported asmycompany.org/thisproj/arithmetic
in<proj-root>/main.go
.
proj-root> make build
proj-root> ./start_daemon TEST
or
proj-root> make build-prod
proj-root> ./start_daemon PROD
or
proj-root> make run-test
or
proj-root> make run-prod
then visit http://localhost:8080/v3/test-api?a=3&b=4
for verification.