Home > Backend Development > Golang > Why Can't I Find the `go-eval` Command After Installation?

Why Can't I Find the `go-eval` Command After Installation?

Susan Sarandon
Release: 2024-12-17 00:39:26
Original
253 people have browsed it

Why Can't I Find the `go-eval` Command After Installation?

Resolving "Command Not Found" Error after Installing Go-eval

During the installation of go-eval, you may encounter an error stating "go-eval: command not found." To resolve this, you'll need to ensure that the go-eval executable is accessible in your system's path.

Go-eval has its binary stored in GOPATH/bin, which is not automatically included in PATH. To add it, follow these steps:

  1. Append GOPATH/bin to PATH:

    PATH="$GOPATH/bin:$PATH"
    Copy after login

Note:

  • GOPATH is typically set to $HOME/golang.
  • If you have explicitly set GOPATH to a different directory, use that path instead.
  1. Set GOPATH and PATH in .profile (Go 1.8 and above):
    Go 1.8 and above default GOPATH to $HOME/go. This means the previous method will not work. To set both GOPATH and PATH correctly, add the following lines to your .profile file:

    export GOPATH="$HOME/go"
    PATH="$GOPATH/bin:$PATH"
    Copy after login
  • Restart your terminal after making these changes to ensure they take effect.

Once your path is updated, you should be able to run go-eval from any directory within your system.

The above is the detailed content of Why Can't I Find the `go-eval` Command After Installation?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template