使用Jenkins Blue Ocean找不到命令

I am trying to set up a Jenkins Blue Ocean pipeline to auto-build my github repo on a PR merge.

I've installed the Go plugins for Jenkins and created the following Jenkinsfile with the help of Blue Ocean. Just wanted it to be very simple at first - I have a shell script to run that will build the program I just need Jenkins to run it on merge.

pipeline {
  agent any
  stages {
    stage('Building Backend') {
      agent any
      steps {
        echo 'Using Go 1.12'
        tool(name: 'Go 1.12', type: 'go')
        echo 'Building Backend...'
        sh 'go version'
      }
    }
  }
}

The above Jenkinsfile returns

go: command not found
script returned exit code 127

but ideally I want it to recognize Go since I will be running a log of go build commands. I added Go as a tool in global tool configuration in the settings of Jenkins.

You can try to execute below command to figure out whether go CLL does exist:

sh 'which go'

Jenkins plugins do not install executables. Think them as controllers. You should install Go into your system and tell Jenkins that the path of the executable in Global Tool Configuration.

You can see an example of Git here:

Example of Global Tool Configuration