目次
Go言語の環境構築
以下の記事を参考に、Go言語の環境構築を完了させてください。
https://reigle.info/entry/2022/11/10/100000reigle.info
Hello Worldを実行する方法
テキストエディタ(VSCodeなど)にて、「helloworld.go
」のファイルを作成する。
「helloworld.go
」には以下を記載する。
package main import "fmt" func main() { fmt.Println("Hello World") }
ターミナルにて、cdコマンドで、「helloworld.go
」のディレクトリへ移動する。
以下のコマンドを実行することで、ターミナルに「Hello World
」が出力されます。
go run helloworld.go