Last active
April 23, 2018 18:49
-
-
Save kemokemo/770d512e7736afa0e89ad13cbfb1382d to your computer and use it in GitHub Desktop.
golang main snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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