mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 01:55:35 +08:00
update book code
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
var num1 int = 7
|
||||
|
||||
switch {
|
||||
case num1 < 0:
|
||||
fmt.Println("Number is negative")
|
||||
case num1 > 0 && num1 < 10:
|
||||
fmt.Println("Number is between 0 and 10")
|
||||
default:
|
||||
fmt.Println("Number is 10 or greater")
|
||||
}
|
||||
}
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
var num1 int = 7
|
||||
|
||||
switch {
|
||||
case num1 < 0:
|
||||
fmt.Println("Number is negative")
|
||||
case num1 > 0 && num1 < 10:
|
||||
fmt.Println("Number is between 0 and 10")
|
||||
default:
|
||||
fmt.Println("Number is 10 or greater")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user