GithubHelp home page GithubHelp logo

go-basics's Introduction

go-basics

Go language basics

This section includes exercises and small projects which illustrate the basics of Go programming language. Things such as: types, data structures, functions, pointers, packages and others.

Section overview

Installation

Before trying any of these examples make sure to have the Go binary installed on your platform.

OSX:

# Install Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install Go

brew install go

Linux:

# Move into $HOME directory
cd ~

# Download the binary for your distribution
curl -O https://dl.google.com/go/go1.12.linux-amd64.tar.gz

# Verify that the downloaded binary is not corrupted. Check if the hash matches the one from downloads page
sha256sum go1.12.linux-amd64.tar.gz

# Extract the binary
tar xvf go1.12.linux-amd64.tar.gz

# Make root user the owner of Go workspace
sudo chown -R root:root ./go

# Move go directory to a standard location
sudo mv go /usr/local

For more details regarding Go installation check out

Golang Installation

For downloading Go binary for your platform checkout

Golang Downloads

To check if you installed Go successfully type:

# Displays installed Go version
go version

# Displays all environment variables defined by Go
go env

Docker:

docker run -it golang:1.11

Set $GOPATH variable

sudo nano ~/.profile

# Linux
export GOPATH=/usr/local/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:/$GOBIN

# OSX
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:/$GOBIN

# Save File

# Restart shell configuration
source ~/.profile

Other Go tools

You can also install other Go tools which will help you have a more productive development process

Go Tools

go get -u golang.org/x/tools/...

Go Lint

go get -u golang.org/x/lint/golint

Go Imports

go get -u golang.org/x/tools/cmd/goimports

Daily routine things

  • Format your entire code recursively using go fmt ./...

  • Lint your entire code recursively using golint ./...

For more info about Go check out

Go Doc

Go Packages

Go Playground

Effective Go

A Tour of Go

For more info about Go commands & WORKSPACE check out

Go commands explained

Go WORKSPACE explained

FEEDBACK βš—

GopherTuts TypeForm

COMMUNITY πŸ™Œ

GopherTuts Discord


Happy hacking gophers πŸš€πŸš€πŸš€

go-basics's People

Contributors

steevehook avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-basics's Issues

Udemy courses links are pointing to wrong url

Description

All Udemy courses in https://github.com/gophertuts/go-basics/tree/master/go-learning-resources are pointing to wrong url:
https://github.com/golang/go/wiki/Books

The correct urls are:

- [Learn How To Code: Google's Go (golang) Programming Language - T. McCleod](https://www.udemy.com/course/learn-how-to-code/)
- [Web Development w/ Google’s Go (golang) Programming Language - T. McCleod](https://www.udemy.com/course/go-programming-language/)
- [Go: The Complete Developer's Guide (Golang) - Stephen Grider](https://www.udemy.com/course/go-the-complete-developers-guide/)

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.