
认知偏差

Today is another day.

Have you encountered the “Package crypto/ecdh is not in GOROOT” error while working with Go in Linux? This error can be frustrating, but it’s typically due to misconfigurations or outdated Go installations. In this quick guide, we’ll walk you through the steps to resolve this issue.
If you suspect that your current Go installation is causing the problem, you can uninstall it before re-installing the latest version. Use the following commands:
$ sudo apt-get remove golang-go
2. Remove the golang-go dependencies:
$ sudo apt-get remove — auto-remove golang-go
3. Uninstall the existing Go package:
$ sudo rm -rvf /usr/local/go
Now, let’s install the latest Go version:
2. Extract the archive file:
$ sudo tar -xvf go1.21.3.linux-amd64.tar.gz
3. Place the extracted Go directory in the desired location (e.g., /usr/local):
$ sudo mv go /usr/local
To configure Go properly, you need to set up environment variables:
$ export GOROOT=/usr/local/go
2. Define GOPATH as your Go workspace directory:
$ export GOPATH=$HOME/go
3. Add Go binary paths to your PATH:
$ export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
4. Reload environment variables:
$ source ~/.profile
Finally, verify your Go installation to ensure it’s working correctly:
$ go version
With these steps, you should have successfully resolved the “Package crypto/ecdh is not in GOROOT” error and updated your Go installation to the latest version. Your Go environment should now be correctly configured and ready for your projects. Happy coding!
Reddit问答版:在你曾经受到的建议里,有哪些是你开始时并不理解但在后来证明非常明智的?
-「爱并不能解决一切问题。」这是一个非常难以学会的事情,尤其是当你如此爱一个人的时候。但有时候,再多的爱也不足以拯救他们免于自我毁灭。他们必须足够爱自己,才会想要改变,而无论你给予他们多少爱,都无法强迫他们这样做。
source:r/AskReddit/comments/1b8sfer/whats_a_piece_of_advice_youve_received_that