Open yuki5155 opened 3 hours ago
# プロジェクトディレクトリに移動
cd /path/to/your/hello-world
# go.modファイルの内容確認
cat go.mod
# 出力例:
# module github.com/yourusername/hello-world
# go 1.16
# main.goファイルの内容確認
cat main.go
# 出力例:
# package main
#
# import "fmt"
#
# func main() {
# fmt.Println("Hello, World!")
# }
# プログラムのインストール
go install
# インストールされたバイナリの確認
ls $GOPATH/bin
# 出力例: hello-world
# インストールしたプログラムの実行
hello-world
# 出力例: Hello, World!