从控制台交互输入用户信息
接收信息主要方法为: fmt.Scanln
package main
import (
"fmt"
)
func main() {
var name string
var age byte
var sal float32
var Ispass bool
fmt.Println("Please input name:")
fmt.Scanln(&name)
fmt.Println("Please input age:")
fmt.Scanln(&age)
fmt.Println("Please input sal:")
fmt.Scanln(&sal)
fmt.Println("Please input Ispass:")
fmt.Scanln(&Ispass)
fmt.Printf("name: %v
age: %v
sal: %v
Ispass: %v",name,age,sal,Ispass)
}