vscode不会检测错误golang

My vscode does not detect errors in golang.

Example:

package somepackage

import "fmt"

func f(name string) string {
    name = 1
    return name
}

This should throw a type error, but it does not. I never get any errors.

My settings.json contains

"go.gopath": "some/path", 
"go.vetOnSave": "package",
"go.lintOnSave": "package",
"go.testOnSave": true,
"go.buildOnSave": "package",
"go.coverOnSave": true 

I was able to run go: install/update Tools. All tools are installed successfully.

I am also able to run debug a .go file in vscode.

As @pwaterz pointed out, the solution to my problem was to add "go.goroot: /some/other/path".

The reason that vscode was not able to detect errors was, that there are different go versions on my computer. Adding the goroot and running go: install/update Tools solved the problem.