Go by Example - Multiple Return Values
Go by Example
Go is an open source programming language designed for building simple, fast, and reliable software.
Go by Example is a hands-on introduction to Go using annotated example programs. Check out the first example or browse the full list below.
Go by Example: Multiple Return Values
golang原生支持多个返回值,这在golang的编程习惯中很常见,如函数同时返回返回值和error。
1 | package main |
1 | $ go run multiple-return-values.go |