This is my first time with GO.
/* hello.go My first GOlang program */
package main
import "fmt"
func main() {
fmt.Printf("Hello World\n")
}
I am getting this error:
# command-line-arguments
/usr/local/go/pkg/tool/darwin_amd64/6g: unknown flag -trimpath
I am not able to understand what is the problem.
Apparently, this is related to the way go has been installed.
See GOlang Some Common Errors
after trying 1.3 meant “you need to unapck your .tar.gz file to /usr/local
http://golang.org/doc/install#tarballOne can not just install the golang 1.3 from the installer, you should try out the untar option for better results.
Errors found during :
brew install spiff go install github.com/tools/godep # github.com/kr/fs /usr/local/go/pkg/tool/darwin_amd64/6g: unknown flag -trimpath
So follow the install section
Download the archive and extract it into /usr/local, creating a Go tree in
/usr/local/go.
For example:tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gzChoose the archive file appropriate for your installation. For instance, if you are installing Go version 1.3 for 64-bit x86 on Linux, the archive you want is called go1.3.linux-amd64.tar.gz.
Add
/usr/local/go/binto thePATHenvironment variable. You can do this by adding this line to your/etc/profile(for a system-wide installation) or$HOME/.profile.export PATH=$PATH:/usr/local/go/bin
To uninstall and start over: see Uninstall Go
To remove an existing Go installation from your system delete the go directory. This is usually
/usr/local/gounder Linux, Mac OS X, and FreeBSD orc:\Gounder Windows.You should also remove the Go
bindirectory from yourPATHenvironment variable.
Under Linux and FreeBSD you should edit/etc/profileor$HOME/.profile. If you installed Go with the Mac OS X package then you should remove the/etc/paths.d/gofile.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With