2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

golang最新版のgo toolで go run hello.go

Posted at

コマンド体系に破壊的な仕様変更があった
今まであったgoinstallや6gや8gはなくなって、主にgoというコマンドに集約されてる。

最新版をいれる

$ hg clone -u weekly https://go.googlecode.com/hg/ go
$ cd go
$ cd src
$ cd ./all.bash
...
$ export PATH=$PATH:~/go/bin
$ which go
/Users/mzi/go/bin/go

ハローワールド

hello.go
package main
import "fmt"

func main(){
    fmt.Printf("Hello, world\n")
}

スクリプト言語のように実行する。


$ go run hello.go
Hello, world

プロジェクトで実行したい場合は go buildなどを使う。あとで書く。

2
3
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?