a book and it says that source code for a package should be in $GOPATH/src , but when I add it and trying to use it, I'm getting main.go:5:2: package tempconv is not in GOROOT (/usr/lib/golang/src/tempconv) . Any help ? Should I add this to GOROOT? Yes, I'm a noob
that book is obsolete 😄
use go mod instead
I recommend you replace your book with this one https://pragprog.com/titles/rggo/powerful-command-line-applications-in-go/
It is from "The Go Programming Language". Maybe some information outdated
it's definitely outdated. We're using go mod now and it's awesome
Alright, thanks:) I'm going to google about go.mod
it's as simple as go mod init <project_name> go mod tidy the project name should be the github repo url, if it's a gh repo
Обсуждают сегодня