mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 22:55:06 +03:00
Run goimports
This commit is contained in:
parent
9c9d0cc7f2
commit
cf7de344a1
2 changed files with 4 additions and 5 deletions
|
@ -15,8 +15,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type CmdLineEnv struct {
|
type CmdLineEnv struct {
|
||||||
args []string
|
args []string
|
||||||
endpoint, server string
|
endpoint, server string
|
||||||
injson, verbose, ver bool
|
injson, verbose, ver bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ func newCmdLineEnv() CmdLineEnv {
|
||||||
return cmdLineEnv
|
return cmdLineEnv
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cmdLineEnv *CmdLineEnv)parseFlagsAndArgs() {
|
func (cmdLineEnv *CmdLineEnv) parseFlagsAndArgs() {
|
||||||
flag.Usage = func() {
|
flag.Usage = func() {
|
||||||
fmt.Fprintf(flag.CommandLine.Output(), "Usage: %s [options] command [key=value] [key=value] ...\n\n", os.Args[0])
|
fmt.Fprintf(flag.CommandLine.Output(), "Usage: %s [options] command [key=value] [key=value] ...\n\n", os.Args[0])
|
||||||
fmt.Println("Options:")
|
fmt.Println("Options:")
|
||||||
|
@ -59,7 +59,7 @@ func (cmdLineEnv *CmdLineEnv)parseFlagsAndArgs() {
|
||||||
cmdLineEnv.ver = *ver
|
cmdLineEnv.ver = *ver
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cmdLineEnv *CmdLineEnv)setEndpoint(logger *log.Logger) {
|
func (cmdLineEnv *CmdLineEnv) setEndpoint(logger *log.Logger) {
|
||||||
if cmdLineEnv.server == cmdLineEnv.endpoint {
|
if cmdLineEnv.server == cmdLineEnv.endpoint {
|
||||||
if config, err := ioutil.ReadFile(defaults.GetDefaults().DefaultConfigFile); err == nil {
|
if config, err := ioutil.ReadFile(defaults.GetDefaults().DefaultConfigFile); err == nil {
|
||||||
if bytes.Equal(config[0:2], []byte{0xFF, 0xFE}) ||
|
if bytes.Equal(config[0:2], []byte{0xFF, 0xFE}) ||
|
||||||
|
|
|
@ -38,7 +38,6 @@ func run() int {
|
||||||
}()
|
}()
|
||||||
|
|
||||||
cmdLineEnv := newCmdLineEnv()
|
cmdLineEnv := newCmdLineEnv()
|
||||||
|
|
||||||
cmdLineEnv.parseFlagsAndArgs()
|
cmdLineEnv.parseFlagsAndArgs()
|
||||||
|
|
||||||
if cmdLineEnv.ver {
|
if cmdLineEnv.ver {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue