Difference between revisions of "Defer"
Jump to navigation
Jump to search
Line 4: | Line 4: | ||
== Example == | == Example == | ||
− | |||
− | |||
− | import "fmt" | + | package main |
− | + | import "fmt" | |
− | func main() { | + | |
− | + | [[func]] main() { | |
− | + | defer fmt.Println("world") | |
− | + | ||
− | } | + | fmt.Println("hello") |
− | + | } | |
== See also == | == See also == |
Revision as of 15:57, 21 August 2022
Example
package main import "fmt" func main() { defer fmt.Println("world") fmt.Println("hello") }
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 - Template:Flow
Advertising: