開発環境
- macOS Mojave - Apple
- Emacs (Text Editor)
- Go 1.11 (プログラミング言語)
Introducing Go: Build Reliable, Scalable Programs (Caleb Doxsey (著)、O'Reilly Media)のChapter 1.(Getting Started)、Exercises(No. 211)1、2、3、4、5.を取り組んでみる。
コード(Emacs)
package main
import (
"fmt"
"os"
)
func main() {
// 2.
// comment1
/*
comment2
*/
fmt.Println("5.")
fmt.Println("Hello, Introducing Go!")
fmt.Println("6.")
os.Exit(10)
}
入出力結果(Terminal)
$ go run sample1.go 5. Hello, Introducing Go! 6. exit status 10 $ echo $? 1 $
Goのstatusコード(10)とos(macOS、terminal(bash))のstatusコード(1)は違うみたい。
0 コメント:
コメントを投稿