04_go language foundation

package main

import (
	"fmt"
)

func main() {
	a, b := 10, 20
	fmt.Println(a, b)

	A, B = B, A // variable exchange
	fmt.Println(a, b)

	was tmp int

	//  _ anonymous variable, do not discard data processing _ the anonymous variable with the return value of the function, have the advantage
	tmp, _ = a, b
	fmt.Println(tmp)

}

Guess you like

Origin www.cnblogs.com/YLlang/p/11005620.html