From 00a4b61cd11a61fb66a359c246045dad753fd32c Mon Sep 17 00:00:00 2001 From: wollomatic Date: Sun, 21 Jul 2024 15:33:14 +0200 Subject: [PATCH] fix some code style issues --- hostsfile.go | 2 +- main.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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()