apt-get install golang
go run main.go //most likely we will be missing few pacakges
export GOPATH=/root/go //Export go Path
mkdir /root/go //make sure that path exists
go get github.com/satori/go.uuid //Downloading and installing packages in go
go get golang.org/x/crypoto/ssh/terminakl //Downloading and installing packages in go
go run main.go
go build //compile a file -- creates an executable
Installing go for Developers
go to https://golang.org/dl/ and copy the link - or you can refer to this link
wget https://dl.google.com/go/go1.14.3.linux-amd64.tar.gz
tar -xvf go1.14.3.linux-amd64.tar.gz -C /usr/local
chown -R root:root /usr/local/go
nano ~/.profile # add these at bottom
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
go version
Installing go --> Easy
Follow the below process to run go scipts from anywhere in the operating system.apt install golang
mkdir /$HOME/go
nano ~/.bashrc #add the below line
export PATH="/home/kali/go/bin:$PATH"
source ~/.bashrc
echo $PATH
#install an application
go get github.com/neex/phuip-fpizdam
phuip-fpizdam
phuip-fpizdam
Resolving Missing packages issue cd directory go mod init file.go go mod tidy
Comments
Post a Comment