refactored utils on dip project
This commit is contained in:
parent
5e086b3078
commit
91aac1a8f9
@ -1,12 +0,0 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Usage displays possible arguments
|
||||
func Usage() {
|
||||
flag.PrintDefaults()
|
||||
os.Exit(1)
|
||||
}
|
@ -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)
|
||||
}
|
Loading…
Reference in New Issue
Block a user