aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2023-07-07 14:10:03 -0400
committerXe Iaso <me@xeiaso.net>2023-07-07 14:10:03 -0400
commitf51b99d8b3b88a2aba3132d1ec1445e02dc48963 (patch)
tree4d46c8fd91807fc855974595214c571f6e679dcb
parent35d19f0b4d0208e408140f65d791285145fbbaa3 (diff)
downloadx-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.go18
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(名字))
+}