-
Notifications
You must be signed in to change notification settings - Fork 0
3. Golang setup on FeeBSD 11.2
Tanveer Alam edited this page Nov 17, 2018
·
4 revisions
Golang setup on FeeBSD 11.2
Referred - https://www.vultr.com/docs/nginx-reverse-proxy-and-golang-setup-on-freebsd
- Install dependencies
[root@ ~/performance/timescaledb]# pkg install wget bzr
- Download Go from https://golang.org/dl/#stable kind = Archive, OS = FreeBSD, Arch = x86-64
[root@ ~/performance/timescaledb]# wget https://dl.google.com/go/go1.11.2.freebsd-amd64.tar.gz
- Extract it at location /usr/local
[root@ ~/performance/timescaledb]# tar -C /usr/local/ -xzf go1.11.2.freebsd-amd64.tar.gz
- Setup Environment Variables
Create a variable called GOPATH (which will be the location for installed packages) and add it to your path
[root@ ~/performance/timescaledb]# mkdir ~/.gopkg
[root@ ~/performance/timescaledb]# echo "setenv GOPATH /root/.gopkg" >> ~/.cshrc
[root@ ~/performance/timescaledb]# echo "set path = ($path /usr/local/go/bin /root/.gopkg/bin)" >> ~/.cshrc
You can verify GOPATH and set path got updated in ~/.cshrc file
[root@ ~/performance/timescaledb]# vi ~/.cshrc
----------------------------------------------------
# should have these two entries at the end
setenv GOPATH /root/.gopkg
set path = ( /usr/local/go/bin /root/.gopkg/bin)
----------------------------------------------------
If your using bash shell
export GOPATH="/root/.gopkg"
export PATH=$PATH:/usr/local/go/bin:/root/.gopkg/bin