Setup CircleCI and goreleaser

This commit is contained in:
Geoff Bourne
2018-05-09 18:37:15 -05:00
parent 17a4bd6515
commit fccf5f9eef
5 changed files with 127 additions and 0 deletions
+18
View File
@@ -9,6 +9,7 @@ import (
"context"
"os"
"os/signal"
"fmt"
)
var (
@@ -18,11 +19,28 @@ var (
String()
mappings = kingpin.Flag("mapping", "Mapping of external hostname to internal server host:port").
StringMap()
versionFlag = kingpin.Flag("version", "Output version and exit").
Bool()
)
var (
version = "dev"
commit = "none"
date = "unknown"
)
func showVersion() {
fmt.Printf("%v, commit %v, built at %v", version, commit, date)
}
func main() {
kingpin.Parse()
if *versionFlag {
showVersion()
os.Exit(0)
}
ctx, cancel := context.WithCancel(context.Background())
c := make(chan os.Signal, 1)