NOGU.D

どっかの大学の学部生のメモ程度の記事

2022-01-17から1日間の記事一覧

Golang プログラムを終了

os.Exit() os.Exitを使うとdeferは実行されない。 package main import ( "fmt" "os" ) func main() { fmt.Println("!") os.Exit(3) } func Exit(code int) Exit causes the current program to exit with the given status code. Conventionally, code zero…