I was using go get
go get the go-sql-driver from github. When I ran the command go get -u github.com/go-sql-driver/mysql
as prompted by the repo, I encountered an error saying "access is denied":
go: writing stat cache: mkdir C:\Program Files\GoPath\pkg: Access is denied.
go: downloading github.com/go-sql-driver/mysql v1.5.0
go get github.com/go-sql-driver/mysql: mkdir C:\Program Files\GoPath\pkg: Access is denied.
I am using Windows 10. This happened when I changed the %GOPATH%
environment variable. Any suggestions on solving this?
It seems like Go doesn't have the right to access the "Program Files" folder. I created a GoPath folder at another place and go get
seemed to work. However, it created a folder named "pkg" in "GoPath", but from the compilation file I am having, it looks like the package should be installed under an "src" folder. Could somebody please explain how this happened?