Golang 101: Introduction to
Go Programming
An introductory journey into the world of Go, designed for beginners
eager to explore this powerful language.
What is Go?
Google's Creation
Born at Google in 2009
Language Family
Open-source, statically
typed, compiled
Designed For
Simplicity, efficiency, and
concurrency
Used For
Cloud, networking, system
programming
Why Learn Go?
1 Clean Syntax
Easy to read and learn
2 High Performance
Compiled, garbage-collected
3 Concurrency
Built-in goroutines
4 Ecosystem
Strong community support
Setting Up Go
Download
From golang.org
Set Up
Env vars GOROOT, GOPATH
Verify
go version
Your First Go Program
package main
import "fmt"
func main() {
fmt.Println("Hello, Go!")
}
package main
Entry point package
import "fmt"
Import standard library
func main() {}
Main function
Go Syntax Basics
1
Variables
var name string = "Go"
2
Constants
const version = 1.18
3
Short
age := 30
Data Types
Basic
int, float64, string,
bool
Composite
array, slice, map,
struct
Example
arr :=
[3]int{1, 2,
3}
Control Structures
If-Else
if age > 18 {}
1
Loop
for i := 0; i < 5; i++ {}
2
Functions
1 Simple Function
func add(a int, b int) int {}
2 Multiple Return
func swap(x, y string) (string, string) {}
Structs and Methods
1
Person Struct
type Person struct {}
2
Greet Method
func (p Person) Greet() {}

Golang-101-Introduction-to-Go-Programming.pptx

  • 1.
    Golang 101: Introductionto Go Programming An introductory journey into the world of Go, designed for beginners eager to explore this powerful language.
  • 2.
    What is Go? Google'sCreation Born at Google in 2009 Language Family Open-source, statically typed, compiled Designed For Simplicity, efficiency, and concurrency Used For Cloud, networking, system programming
  • 3.
    Why Learn Go? 1Clean Syntax Easy to read and learn 2 High Performance Compiled, garbage-collected 3 Concurrency Built-in goroutines 4 Ecosystem Strong community support
  • 4.
    Setting Up Go Download Fromgolang.org Set Up Env vars GOROOT, GOPATH Verify go version
  • 5.
    Your First GoProgram package main import "fmt" func main() { fmt.Println("Hello, Go!") } package main Entry point package import "fmt" Import standard library func main() {} Main function
  • 6.
    Go Syntax Basics 1 Variables varname string = "Go" 2 Constants const version = 1.18 3 Short age := 30
  • 7.
    Data Types Basic int, float64,string, bool Composite array, slice, map, struct Example arr := [3]int{1, 2, 3}
  • 8.
    Control Structures If-Else if age> 18 {} 1 Loop for i := 0; i < 5; i++ {} 2
  • 9.
    Functions 1 Simple Function funcadd(a int, b int) int {} 2 Multiple Return func swap(x, y string) (string, string) {}
  • 10.
    Structs and Methods 1 PersonStruct type Person struct {} 2 Greet Method func (p Person) Greet() {}