Difference between revisions of "For (go lang)"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
− | |||
− | |||
− | import "fmt" | + | [[package]] main |
− | + | ||
− | func main() { | + | [[import]] "fmt" |
− | + | ||
− | + | [[func]] main() { | |
− | + | sum := 0 | |
− | + | ||
− | + | for { | |
+ | sum++ | ||
+ | fmt.Println(sum) | ||
+ | } | ||
} | } | ||
− | |||
− | |||
== See also == | == See also == |
Revision as of 08:12, 29 August 2021
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: