A complete guide to GoLang
Golang Notes from multiple sources.
Pre-requisite to understand the content
Using Golang 1.16
Go is a general purpose programming language. It is open source. It is NOT an object-oriented programming language.
Due to its concurrency feature it is ideal for multi-core and networked machines. Best suited for modular
software designs. Compiles very quickly and performs runtime reflection. Developed
by Google in 2007, announced in 2009 and stable version released in 2015. Go is a
case sensitive language.
Go is not an Object Oriented Programming Language.
Go can be downloaded from https://golang.org/dl/ . The installer will append PATH
variable of the system with the directory path to go/bin. By default, the working directory
is taken as $HOME/go. It set it something different from the convention, an environment
variable GOPATH needs to be created. For detailed steps for installation instructions,
follow this link https://golang.org/doc/install .
Building a go file, creates an executable file, with the same name as the go file,
in the same location. Suppose the script is main.go
. The executable can be
executed in mac by writing ./main
and in windows by main.exe
.
Some of the frequently used commands are:
if
and for
statements.hello, data_structure,
and conditionals contain scripts based on the concepts learned.
file
and os
packages.http_interface, interface
contain scripts based on the concepts learned.
There are some more scripts in the single_page_scripts
directory. The file names are kept intuitive.
Cards is a simple project for dealing a set of cards.
Knowledge Check contains some logics that can challenge the reader’s understanding.