diff options
| author | Xe Iaso <me@xeiaso.net> | 2023-07-07 14:10:03 -0400 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2023-07-07 14:10:03 -0400 |
| commit | f51b99d8b3b88a2aba3132d1ec1445e02dc48963 (patch) | |
| tree | 4d46c8fd91807fc855974595214c571f6e679dcb | |
| parent | 35d19f0b4d0208e408140f65d791285145fbbaa3 (diff) | |
| download | x-f51b99d8b3b88a2aba3132d1ec1445e02dc48963.tar.xz x-f51b99d8b3b88a2aba3132d1ec1445e02dc48963.zip | |
conferences/gceu23: oh what you can use hanzi in Go variable names?
Signed-off-by: Xe Iaso <me@xeiaso.net>
| -rw-r--r-- | conferences/gceu23/wasip1/nihao.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/conferences/gceu23/wasip1/nihao.go b/conferences/gceu23/wasip1/nihao.go new file mode 100644 index 0000000..5a5c56e --- /dev/null +++ b/conferences/gceu23/wasip1/nihao.go @@ -0,0 +1,18 @@ +//go:build ignore + +package main + +import ( + "bufio" + "fmt" + "os" + "strings" +) + +func main() { + reader := bufio.NewReader(os.Stdin) + fmt.Print("你叫什么名字?") + os.Stdout.Sync() + 名字, _ := reader.ReadString('\n') + fmt.Printf("你好%s!", strings.TrimSpace(名字)) +} |
