Giter Site home page Giter Site logo

go's Introduction

Go installation Ubuntu 17

This is short instruction about GoLang installtion from https://golang.org/dl/

At first - update your system

$ sudo apt update
$ sudo apt upgrade

Then download compile file from golang.org (at this moment currently version is go1.10.2.linux-amd64.tar.gz). Use that command

$  sudo curl -O https://storage.googleapis.com/golang/go1.10.2.linux-amd64.tar.gz

Next unpack this archive in local folder

$ sudo tar -xvf go1.10.2.linux-amd64.tar.gz
$ sudo mv go /usr/local

I use VSCODE and therefore execute command with vscode for path variables setting. Just execute this command in terminal and add export part in the end of /etc/profile file

$  vscode /etc/profile
export PATH=$PATH:/usr/local/go/bin

Also add this path to /etc/bashrc with next command (for vscode /etc/bashrc I have warning message and therefore use sudo nano)

$ sudo nano /etc/bashrc

Save it and update your source

$ source /etc/profile

Then restart your machine and check the version (shold work)

$ go version

After that make working directory with src folder and try to start HelloWorld.go project

$ mkdir workplace/src/helloworld
$ cd workplace/src/helloworld

Add GOPATH to /etc/bashrc and /etc/profile (like above) for regular use

$  export GOPATH=$HOME/workplace/

Make Hello.go in helloworld directory

$ vscode Hello.go

Type next code in VSCode

package main

import "fmt"

func main() {
	fmt.Println("Hello, World!")
}

Save it and try to execute (you should be in helloworld directory)

$ go run Hello.go

If you see the result --- perfect :)

Hope, It'll be useful for GoLang istallation on Ubuntu17.

go's People

Contributors

vlasove 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.