diff --git a/hostsfile.go b/hostsfile.go index 55c3aa4..4849289 100644 --- a/hostsfile.go +++ b/hostsfile.go @@ -14,7 +14,7 @@ import ( // refreshHostsfile reads the docker containers, creates the container list and starts writeHostsfile() to write the hosts file func refreshHostsfile(cli *client.Client) error { - dockerHosts := []byte{} + var dockerHosts []byte containers, err := cli.ContainerList(context.Background(), types.ContainerListOptions{}) if err != nil { diff --git a/main.go b/main.go index a785b64..f05c9a4 100644 --- a/main.go +++ b/main.go @@ -15,19 +15,19 @@ import ( ) const ( - PROGRAM_NAME = "container-hoster" - PROGRAM_URL = "github.com/wollomatic/container-hoster" + programName = "container-hoster" + programURL = "github.com/wollomatic/container-hoster" ) var ( - refreshHostsfileNeeded bool = true + refreshHostsfileNeeded = true networkRegexpCompiled *regexp.Regexp version = "develop" // will be set in Github Action ) func main() { - log.Printf("--- Starting %s %s (%s, %s, %s) %s ---\n", PROGRAM_NAME, version, runtime.GOOS, runtime.GOARCH, runtime.Version(), PROGRAM_URL) + log.Printf("--- Starting %s %s (%s, %s, %s) %s ---\n", programName, version, runtime.GOOS, runtime.GOARCH, runtime.Version(), programURL) conf.getFromENV() conf.logConfig()