The Docker pipeline plugin should be installed.
The proper Jenkinsfile:
pipeline {
agent {
docker {
image 'golang:latest'
}
}
stages {
stage('Dev') {
steps {
git 'https://github.com/kodekloudhub/go-webapp-sample.git'
sh 'go version'
}
}
}
}