1
0
mirror of https://github.com/taigrr/godns synced 2025-01-18 04:03:25 -08:00

fix golint warnings

This commit is contained in:
Timothy 2017-10-27 11:57:54 +08:00
parent d4875c1064
commit e0bde61c5c
3 changed files with 9 additions and 4 deletions

View File

@ -22,6 +22,7 @@ type DNSPodHandler struct {
Configuration *godns.Settings
}
// SetConfiguration pass dns settings and store it to handler instance
func (handler *DNSPodHandler) SetConfiguration(conf *godns.Settings) {
handler.Configuration = conf
}

View File

@ -24,6 +24,7 @@ const (
HE = "HE"
)
// GetCurrentIP gets public IP from internet
func GetCurrentIP(configuration *Settings) (string, error) {
client := &http.Client{}
@ -55,6 +56,7 @@ func GetCurrentIP(configuration *Settings) (string, error) {
return string(body), nil
}
// IdentifyPanic identifies panic and output the detailed panic infomation
func IdentifyPanic() string {
var name, file string
var line int
@ -83,11 +85,13 @@ func IdentifyPanic() string {
return fmt.Sprintf("pc:%x", pc)
}
// Usage prints the usage of GoDNS
func Usage() {
log.Println("[command] -c=[config file path]")
flag.PrintDefaults()
}
// CheckSettings check the format of settings
func CheckSettings(config *Settings) error {
if config.Provider == DNSPOD {
if (config.Email == "" || config.Password == "") && config.LoginToken == "" {