How to use for and foreach loop in Golang?
There is only one looping construct in Golang, and that is the for loop. The for loop in Golang has three components, which must be separated by semicolons (;), those are:Â The initialization statement: which is executed before the first iteration. e.g. i := 0The condition expression: which is execu