pipeline { agent { label 'go' } tools { go 'go-1.16' } environment { GO111MODULE = 'on' } stages { stage('Compile') { steps { sh 'go build' } } stage('Test') { steps { withEnv(["GOROOT=${root}, "PATH+GO=${root}/bin:${HOME}/go/bin"]) { sh "go test -v ./..." } } } } }