Difference between revisions of "For (go lang)"
Jump to navigation
Jump to search
(Created page with " <pre> package main import "fmt" func main() { sum := 0 for { sum++ // repeated forever fmt.Println(sum) } } </pre> == See also == * {{go}}") |
|||
Line 7: | Line 7: | ||
func main() { | func main() { | ||
− | sum := 0 | + | sum := 0 |
for { | for { | ||
− | sum++ | + | sum++ |
fmt.Println(sum) | fmt.Println(sum) | ||
} | } |
Revision as of 08:09, 29 April 2020
package main import "fmt" func main() { sum := 0 for { sum++ fmt.Println(sum) } }
See also
- Go, Gorutine:
go [ mod
|list
|fmt
,for
|build
|get
|version
|env | install | test
]go help
, Go template, Echo go web framework, Go packages, Blank identifier
Advertising: