代码演示 package main import "fmt" import "time" func main() { i := 2 fmt.Print("write ", i, " as ") switch i { case 1: fmt.Println("one") case 2: fmt.Println("two") case 3: fmt.Println("three&q…
If a < 5 Then Response.Redirect("1.asp")ElseIf a > 5 And a < 8 Then Response.Redirect("2.asp")ElseIf a > 7 And a < 19 Then Response.Redirect("3.asp")ElseIf a > 18 Then Response.Redirect("4.asp&q…
相信这样的语句在go中大家见的很多 switch t := arg.(type) { default: fmt.Printf("unexpected type %T\n", t) // %T prints whatever type t has case bool: fmt.Printf("boolean %t\n", t) // t has type bool case int: fmt.Printf("integer %d\n", t) //…