3. What is Golang?
Go or Golang is a
programming language
created by Google in 2009.
Uses syntaxes similar to C
4. Features
Simplicity
Go is a relatively simple language and was designed with a very
minimalistic approach
01
Concurrency mechanisms
Go make it easy to write programs that get the most out of multi core and
networked machines
02
Object Orientated
Object-oriented programming is a programming paradigm based on the
concept of "objects"
03
The Compiler
Go’s compiler is super fast. It is easily possible to compile a large Go
program within a few seconds.
04
6. Go Structure
There are 3 main sections
in a Go programme
package main
import "fmt"
func main(){
fmt.Println("Hello World")
}
Packages
Imports
Functions
7. What is a package?
A set of source files organized into a system directory.
Eg: fmt, Math, main
8. Every Go program is made up of packages.
Executable files starts in “main” package.
Main tells the Go compiler to compile the
programe as an executable file
9. What is import?
A command (A keyword) used to import a package
into another package.
10. What are functions?
A function is an independent section of code that
maps zero or more input parameters to zero or more
output parameters.
11. How to write?
Define the function.
Define parameters.
Define output data type.
Define the action
Sample of an add function