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
|
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)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user