cannot find package "text/template"

75 views
Skip to first unread message

ThisEndUp

unread,
Jun 13, 2019, 1:05:15 AM6/13/19
to golang-nuts
All of a sudden, when trying to build programs that used to work, as recently as a couple of days ago, I'm getting

main.go:6:2: cannot find package "text/template" in any of:
 C
:\Go\src\text\template (from $GOROOT)
 D
:\<user>\Go\src\text\template (from $GOPATH)


I was trying this in a module, but when the error popped up, I copied the program into a directory in $GOPATH/src and got the same result.

go version reports "go1.12 windows/amd64". I'm using a 64-bit Windows 10 Home machine.

Is anyone else experiencing this? Is it temporary? Is there a work-around?

Thanks!

ThisEndUp

unread,
Jun 13, 2019, 10:49:54 PM6/13/19
to golang-nuts
Not sure what caused the problem to pop up from one day to the next, but I repaired it by downloading go-master.zip from github and extracting the directory text into $GOROOT/src . It now works both as a module and within $GOPATH/src.

Wagner Riffel

unread,
Jun 14, 2019, 1:37:07 AM6/14/19
to ThisEndUp, golang-nuts
Hi Tenney, clearly something went wrong with /src directory, you
reported your compiler to be go1.12, so it'd be a better idea to
download the go tree from go1.12 release branch instead of tip,
https://github.com/golang/go/tree/release-branch.go1.12
Reply all
Reply to author
Forward
0 new messages