-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
47 lines (41 loc) · 2.04 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package main
import (
"Pandora_Box/repl"
"fmt"
"os"
)
const banner = ` ██████╗ █████╗ ███╗ ██╗██████╗ ██████╗ ██████╗ █████╗ ██████╗ ██████╗ ██╗ ██╗
██╔══██╗██╔══██╗████╗ ██║██╔══██╗██╔═══██╗██╔══██╗██╔══██╗ ██╔══██╗██╔═══██╗╚██╗██╔╝
██████╔╝███████║██╔██╗ ██║██║ ██║██║ ██║██████╔╝███████║ ██████╔╝██║ ██║ ╚███╔╝
██╔═══╝ ██╔══██║██║╚██╗██║██║ ██║██║ ██║██╔══██╗██╔══██║ ██╔══██╗██║ ██║ ██╔██╗
██║ ██║ ██║██║ ╚████║██████╔╝╚██████╔╝██║ ██║██║ ██║███████╗██████╔╝╚██████╔╝██╔╝ ██╗
╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝`
const description = `
Hello! This is the Pandora_Box. Wish you happy! :)
`
func init() {
// banner
fmt.Println(banner)
// description
fmt.Println(description)
}
func main() {
repl.Start(os.Stdin, os.Stdout)
// doSomething(123)
}
func doSomething(i interface{}) {
switch v := i.(type) {
case int:
fmt.Println(v)
fmt.Printf("整数: %d\n", v)
case string:
fmt.Println(v)
fmt.Printf("字符串: %s\n", v)
case bool:
fmt.Println(v)
fmt.Printf("布尔值: %t\n", v)
default:
fmt.Println(v)
fmt.Printf("未知类型: %T\n", v)
}
}