From a632a07ab8cc9546c3a04eafebf5889f094e4851 Mon Sep 17 00:00:00 2001 From: tobiichi3227 <86729076+tobiichi3227@users.noreply.github.com> Date: Wed, 2 Apr 2025 22:51:28 +0800 Subject: [PATCH] add golang version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 要跟我一輩子寫 golang 嗎? --- run/print.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 run/print.go diff --git a/run/print.go b/run/print.go new file mode 100644 index 0000000..17f2241 --- /dev/null +++ b/run/print.go @@ -0,0 +1,16 @@ +package main + +import ( + "fmt" + "os" +) + +func main() { + filename := "找找自己問題.txt" + data, err := os.ReadFile(filename) + if err != nil { + fmt.Printf("無法讀取檔案 '%v': %v\n", filename, err) + } else { + fmt.Print(string(data)) + } +}