fix bug
This commit is contained in:
29
internal/conf/config.go
Normal file
29
internal/conf/config.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package conf
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Hostname string
|
||||
Account string
|
||||
AccountID string
|
||||
}
|
||||
|
||||
func Get() *Config {
|
||||
host, _ := os.Hostname()
|
||||
host = strings.ToLower(host)
|
||||
|
||||
switch host {
|
||||
case "desktop-t5lh34v":
|
||||
return &Config{Hostname: host, Account: "david", AccountID: "86037237"}
|
||||
case "t8zznqs49f1ju7q":
|
||||
return &Config{Hostname: host, Account: "liao", AccountID: "8889399698"}
|
||||
case "dhzd0ojkpctafmm":
|
||||
return &Config{Hostname: host, Account: "zhang", AccountID: "8889616198"}
|
||||
case "f7tib45aqk4n10h":
|
||||
return &Config{Hostname: host, Account: "long", AccountID: "8886508526"}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user