An Ultimate GopherLabs Hands-on Labs Decision Making In Golang
• Docker Community Leader , Bangalore • Author :- lightweight Kubernetes with k3s with packt Publication • Gopherlabs – 200+ tutorials • Okteto – Kubernetes For Developer , Bangalore Meetup Organizer Who Am I? @BiradarSangam Sangam Biradar EngineITops.com
● Loop - Init, Condition, Post https://play.golang.org/p/Qr0mY2p7zF0 for init; condition; post { } Note: There is no while in Golang.
● for condition while-ish https://play.golang.org/p/SX3Cok8QcH8
● Loop - Nested Loops https://play.golang.org/p/3Uh8sboc_5X https://play.golang.org/p/0Gd_NAXNyB
● for No Condition https://play.golang.org/p/CRBzK0EcTYA
● break https://play.golang.org/p/HXSLnB-kX-v break will break out of a loop. It's a way to stop looping.
● continue https://play.golang.org/p/FD6rAvqbCfp continue will move on to the next iteration
● rune loop UTF-8 https://play.golang.org/p/6A1Q-hjg-rh https://play.golang.org/p/yEN5CthpDOQ
● rune ● A rune is a type meant to represent a Unicode code point. ● The rune type is an alias for int32, and is used to emphasize than an integer represents a code point. ● ASCII defines 128 characters, identified by the code points 0–127. It covers English letters, Latin numbers, and a few other characters. ● Unicode, which is a superset of ASCII, defines a codespace of 1,114,112 code points. Unicode version 10.0 covers 139 modern and historic scripts, as well as multiple symbol sets. ● Note that a string is a sequence of bytes, not runes. ● However, strings often contain Unicode text encoded in UTF-8, which encodes all Unicode code points using one to four bytes, and Go source code is always encoded in UTF-8. This encoding was in fact designed by Ken Thompson and Rob Pike, two of the main creators of Go.
fmt.Println([]rune("okteto")) Package reflect implements run-time reflection, allowing a program to manipulate objects with arbitrary types. The typical use is to take a value with static type interface{} and extract its dynamic type information by calling TypeOf, which returns a Type. A call to ValueOf returns a Value representing the run-time data. Zero takes a Type and returns a Value representing a zero value for that type. https://play.golang.org/p/u3tdGtiU6UT
● Conditional - If Statement https://play.golang.org/p/7Or016bH0YP https://play.golang.org/p/Q1QjvxZzFX https://play.golang.org/p/Aok8L_OVMo
● Conditional - If, Else if, Else https://play.golang.org/p/o2LQFJxWNR https://play.golang.org/p/a3jbqR2vXp
●Loop condition modulo https://play.golang.org/p/5MIcWPR-4fL
● Conditional - Switch Statement https://play.golang.org/p/1EtC2k2rvXhttps://play.golang.org/p/Vk9yIJGkKy
https://play.golang.org/p/QK2Tu6x-SL You can use fallthrough to make each statement evaluate
● Conditional Logic Operators https://play.golang.org/p/ukFrlC66uv https://play.golang.org/p/cZEfXSIIDO
● References ● https://gopherlabs.collabnix.com ● https://godoc.org/ ● https://golang.org/doc/
Thanks! Any questions? @sangambiradar@BiradarSangamSangam Biradar

Decision making - for loop , nested loop ,if-else statements , switch in gopherlabs

  • 1.
    An Ultimate GopherLabs Hands-onLabs Decision Making In Golang
  • 2.
    • Docker CommunityLeader , Bangalore • Author :- lightweight Kubernetes with k3s with packt Publication • Gopherlabs – 200+ tutorials • Okteto – Kubernetes For Developer , Bangalore Meetup Organizer Who Am I? @BiradarSangam Sangam Biradar EngineITops.com
  • 4.
    ● Loop -Init, Condition, Post https://play.golang.org/p/Qr0mY2p7zF0 for init; condition; post { } Note: There is no while in Golang.
  • 5.
    ● for conditionwhile-ish https://play.golang.org/p/SX3Cok8QcH8
  • 6.
    ● Loop -Nested Loops https://play.golang.org/p/3Uh8sboc_5X https://play.golang.org/p/0Gd_NAXNyB
  • 7.
    ● for NoCondition https://play.golang.org/p/CRBzK0EcTYA
  • 8.
    ● break https://play.golang.org/p/HXSLnB-kX-v break willbreak out of a loop. It's a way to stop looping.
  • 9.
  • 10.
    ● rune loopUTF-8 https://play.golang.org/p/6A1Q-hjg-rh https://play.golang.org/p/yEN5CthpDOQ
  • 11.
    ● rune ● Arune is a type meant to represent a Unicode code point. ● The rune type is an alias for int32, and is used to emphasize than an integer represents a code point. ● ASCII defines 128 characters, identified by the code points 0–127. It covers English letters, Latin numbers, and a few other characters. ● Unicode, which is a superset of ASCII, defines a codespace of 1,114,112 code points. Unicode version 10.0 covers 139 modern and historic scripts, as well as multiple symbol sets. ● Note that a string is a sequence of bytes, not runes. ● However, strings often contain Unicode text encoded in UTF-8, which encodes all Unicode code points using one to four bytes, and Go source code is always encoded in UTF-8. This encoding was in fact designed by Ken Thompson and Rob Pike, two of the main creators of Go.
  • 12.
    fmt.Println([]rune("okteto")) Package reflect implementsrun-time reflection, allowing a program to manipulate objects with arbitrary types. The typical use is to take a value with static type interface{} and extract its dynamic type information by calling TypeOf, which returns a Type. A call to ValueOf returns a Value representing the run-time data. Zero takes a Type and returns a Value representing a zero value for that type. https://play.golang.org/p/u3tdGtiU6UT
  • 13.
    ● Conditional -If Statement https://play.golang.org/p/7Or016bH0YP https://play.golang.org/p/Q1QjvxZzFX https://play.golang.org/p/Aok8L_OVMo
  • 14.
    ● Conditional -If, Else if, Else https://play.golang.org/p/o2LQFJxWNR https://play.golang.org/p/a3jbqR2vXp
  • 15.
  • 16.
    ● Conditional -Switch Statement https://play.golang.org/p/1EtC2k2rvXhttps://play.golang.org/p/Vk9yIJGkKy
  • 17.
    https://play.golang.org/p/QK2Tu6x-SL You can usefallthrough to make each statement evaluate
  • 18.
    ● Conditional LogicOperators https://play.golang.org/p/ukFrlC66uv https://play.golang.org/p/cZEfXSIIDO
  • 19.
    ● References ● https://gopherlabs.collabnix.com ●https://godoc.org/ ● https://golang.org/doc/
  • 20.