摘要:
There is no While loop in Go, but you can use For loop as while loop: i := 1 for i < 100 { fmt.Println(i) i += 1 } func main() { var myTxt = "This is 阅读全文
posted @ 2022-09-04 16:29
Zhentiw
阅读(27)
评论(0)
推荐(0)
摘要:
fallthrough keyword is used in switch statement in golang. This keyword is used in switch case block. If the fallthrough keyword is present in the cas 阅读全文
posted @ 2022-09-04 16:19
Zhentiw
阅读(84)
评论(0)
推荐(0)
摘要:
// Defined a err variable err and assige the return value of someFunction() // err only available in if {} block, not outside if err := someFunction() 阅读全文
posted @ 2022-09-04 16:02
Zhentiw
阅读(30)
评论(0)
推荐(0)
摘要:
package main import ( "fmt" ) func main() { var firstName string = "firstName" var lastName = "lastName" var fullName string // Go will assign default 阅读全文
posted @ 2022-09-04 15:58
Zhentiw
阅读(27)
评论(0)
推荐(0)
摘要:
Can use reflect.TypeOf to get variable type package main import ( "fmt" "reflect" ) func main() { // var age int = 21 // var b bool = age >= 23 var ag 阅读全文
posted @ 2022-09-04 15:52
Zhentiw
阅读(40)
评论(0)
推荐(0)

浙公网安备 33010602011771号