DEV Community

Shootacean
Shootacean

Posted on • Edited on • Originally published at shootacean.com

GoでのHello, World

#go

GoのインストールからHello, Worldを出力するまでの手順です。

MacにGoをインストールする

$ brew install go
$ go version
go version go1.12.7 darwin/amd64
Enter fullscreen mode Exit fullscreen mode

Hello,Worldの実装

$ touch hello.go
Enter fullscreen mode Exit fullscreen mode
package main

import "fmt"

func main() {
    fmt.Println("Hello, World")
}
Enter fullscreen mode Exit fullscreen mode

Hello, Worldプログラムの実行

$ go run hello.go
Hello, World
Enter fullscreen mode Exit fullscreen mode

Top comments (2)

Collapse
 
dentych profile image
Dennis

I'm sorry, but what is the purpose of this? Are you making some sort of personal note folder on Dev.to? :P

Collapse
 
shootacean profile image
Shootacean

I'm sorry. This is a post test. It will be deleted after a while. :(