From 91aac1a8f9655f8e37ca1c4045eeb151cf880936 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 10 Mar 2020 14:58:20 +0100 Subject: [PATCH] refactored utils on dip project --- utils/usage.go | 12 ------------ utils/{flags.go => utils.go} | 12 +++++++++++- 2 files changed, 11 insertions(+), 13 deletions(-) delete mode 100644 utils/usage.go rename utils/{flags.go => utils.go} (57%) diff --git a/utils/usage.go b/utils/usage.go deleted file mode 100644 index d6f52a5..0000000 --- a/utils/usage.go +++ /dev/null @@ -1,12 +0,0 @@ -package utils - -import ( - "flag" - "os" -) - -// Usage displays possible arguments -func Usage() { - flag.PrintDefaults() - os.Exit(1) -} diff --git a/utils/flags.go b/utils/utils.go similarity index 57% rename from utils/flags.go rename to utils/utils.go index b76ea73..e252920 100644 --- a/utils/flags.go +++ b/utils/utils.go @@ -1,10 +1,20 @@ package utils -import "flag" +import ( + "flag" + "os" +) +// Flags configure flag management func Flags(host *string, port *string) { flag.Usage = Usage flag.StringVar(host, "host", "[::]", "Listen host") flag.StringVar(port, "port", "8080", "Listen port") flag.Parse() } + +// Usage displays possible arguments +func Usage() { + flag.PrintDefaults() + os.Exit(1) +}