Closed
Description
What version of Go are you using (go version
)?
$ go version go version go1.12.7 linux/amd64
What did you do?
the sample code:
package main
import (
"log"
"os"
)
func main() {
file, error := os.Open("hs.json")
if error != nil {
log.Println("open file ", error)
return
}
defer file.Close()
h := func(string) error {
return nil
}
h("hello")
}
What did you see instead?
i am beginner with golang, the go vet output is 'error is not a type'. so, it can be confusing to fix problem