Getting started with Go — Loops

  • For loops
  • While loops
  • Do while loops
for var := 1; var < 10; var ++{   fmt.Println(var)
}
var isMarried bool
counter := 0
for isMarried != true{ if counter == 10{
isMarried = true
}fmt.Println(counter)counter += 1}
counter := 0for{if counter == 10{   break
}
fmt.Println(counter)
counter += 1
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Matthew Boyd

Matthew Boyd

Learning, and posting my findings!