Skip to content

Instantly share code, notes, and snippets.

@kemokemo
Last active April 23, 2018 18:49
Show Gist options
  • Save kemokemo/770d512e7736afa0e89ad13cbfb1382d to your computer and use it in GitHub Desktop.
Save kemokemo/770d512e7736afa0e89ad13cbfb1382d to your computer and use it in GitHub Desktop.
golang main snippet
package main
import (
"log"
"os"
)
const (
exitCodeOK int = iota
exitCodeFailed
)
func main() {
os.Exit(run(os.Args))
}
func run(args []string) int {
err := work()
if err != nil {
log.Println("Failed to execute the work:", err)
return exitCodeFailed
}
return exitCodeOK
}
func work() error {
return nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment