//switch
package main
import (
"fmt"
)
func main() {
switch os :="mysql"
os {
case "darwin":
fmt.Println("OS X.")
case "linux":
fmt.Println("Linux.")
case "mysql":
fmt.Println("mysql.")
default:
fmt.Printf("%s", os)
}
}
//for
package main
import ("fmt")
func main() {
for a:=1;a<=10;a++ {
fmt.Println(a)
}
}
//if判断
package main
import ("fmt")
func main() {
a := 9
if a<10 {
fmt.Println("比10小")
}else{
fmt.Println("大于等会10")
}
}