This is a creation in Article, where the information may have evolved or changed.
1. Error description
Error when installing Beego using the following method
get github.com/astaxie/beego
Error message:
Go install unicode/utf8:open/opt/go/pkg/linux_amd64/unicode/utf8.a:permission denied
Go install unicode:open/opt/go/pkg/linux_amd64/unicode.a:permission denied
Go install math:open/opt/go/pkg/linux_amd64/math.a:permission denied
Go install sort:open/opt/go/pkg/linux_amd64/sort.a:permission denied
Go install hash:open/opt/go/pkg/linux_amd64/hash.a:permission denied
Go install unicode/utf16:open/opt/go/pkg/linux_amd64/unicode/utf16.a:permission denied
Go install crypto/subtle:open/opt/go/pkg/linux_amd64/crypto/subtle.a:permission denied
Go install container/list:open/opt/go/pkg/linux_amd64/container/list.a:permission denied
Go install internal/syscall:open/opt/go/pkg/linux_amd64/internal/syscall.a:permission denied
Go install time:open/opt/go/pkg/linux_amd64/time.a:permission denied
Then I put a sudo in front of the command and then prompted
Go:cannot Find Goroot directory:/usr/local/go
2. Workaround
Go install unicode/utf8:open/opt/go/pkg/linux_amd64/unicode/utf8.a:permission denied
The cause of this error is that I was directly golang compressed into the/OPT directory, all the source code is not compiled, should first switch to/OPT/GO/SRC directory, execute sudo. Make.bash script compilation, after the completion of using the following command to install Beego will not be wrong:
get github.com/astaxie/beego
In this case, you will be prompted to install the Bee tool with insufficient permissions when you execute the following command:
get github.com/beego/bee
Go install github.com/beego/bee:open/opt/go/bin/bee:permission denied
My solution to this is to first switch to the/OPT directory, execute the following command, modify the Go folder permissions:
sudo777 go/
This will install the Bee tool properly.