refactored utils on dip project

This commit is contained in:
Paul 2020-03-10 14:58:20 +01:00
parent 5e086b3078
commit 91aac1a8f9
2 changed files with 11 additions and 13 deletions

View File

@ -1,12 +0,0 @@
package utils
import (
"flag"
"os"
)
// Usage displays possible arguments
func Usage() {
flag.PrintDefaults()
os.Exit(1)
}

View File

@ -1,10 +1,20 @@
package utils package utils
import "flag" import (
"flag"
"os"
)
// Flags configure flag management
func Flags(host *string, port *string) { func Flags(host *string, port *string) {
flag.Usage = Usage flag.Usage = Usage
flag.StringVar(host, "host", "[::]", "Listen host") flag.StringVar(host, "host", "[::]", "Listen host")
flag.StringVar(port, "port", "8080", "Listen port") flag.StringVar(port, "port", "8080", "Listen port")
flag.Parse() flag.Parse()
} }
// Usage displays possible arguments
func Usage() {
flag.PrintDefaults()
os.Exit(1)
}