Git Product home page Git Product logo

golang-starter's Introduction

golang-starter

installation Guide of golang 1.11 for linux distros

$ sudo apt-get update $ sudo apt-get -y upgrade

Downlaod the golang 1.11 from Offical golang website Offical Download page

Next, you need to extract the files from the archive downloaded by running the command:

$ sudo tar -xvf go1.10.linux-amd64.tar.gz Next, move the go folder to the final destination:

$ sudo mv go /usr/local

Setup GO ENVIRONMENT VARIABLES

In order to be able to use the Go language, the GOROOT, GOPATH and PATH environment variables need to be set up.

GOROOT is the location where Go package is installed on your system, in our case /usr/local/go. Run the following command to set up the variable:

$ export GOROOT=/usr/local/go GOPATH is the location of your work directory. Run the following command to set up the variable using your own folder:

$ export GOPATH=$HOME/Golang Next, set up the PATH variable to access go binary system-wide.

$ export PATH=$GOPATH/bin:$GOROOT/bin:$PATH All three environment variables will be set for your current session only. If you want to make it permanent add the commands in ~/.profile file. You can edit the file using the vi editor.

$ vi ~/.profile

Verify Installation

To verify the go version just type the following command, if everything went well the go version will be displayed:

$ go version go version go1.10 linux/amd64

To verify all the go variables, run the following command:

$ go env

GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/adm/Repositories/admfactory" GORACE="" GOROOT="/usr/local/go" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build698684453=/tmp/go-build -gno-record-gcc-switches" CXX="g++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config"

You are done now.

Happy Coding!!!

golang-starter's People

Watchers

James Cloos avatar Himanshu Gupta avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.