Encountered a strange error when I tried to compile following code:
package main import fmt "fmt" func main() { var arr [3]int for i:=0; i<3; i++ { fmt.Printf("%d",arr[i]) } }
Error is as follows:
unexpected semicolon or newline before {
After correction following code worked:
package main import fmt "fmt" func main(){ var arr [3]int for i:=0; i<3; i++{ fmt.Printf("%d",arr[i]) } }
Is GO language this much strictly Typed? And this doesn't have warnings also. Should this not be a programmers choice how he wants to format his code? Go language warnings and errors