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
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)
}