1
0
mirror of https://github.com/rancher/os.git synced 2025-08-31 14:23:11 +00:00

Fix golint check error

https://github.com/rancher/os/issues/2166
This commit is contained in:
niusmallnan
2017-12-06 13:45:49 +08:00
parent d8bba34a87
commit 7b474cd905
8 changed files with 13 additions and 62 deletions

View File

@@ -23,11 +23,7 @@ func SetHostnameFromCloudConfig(cc *config.CloudConfig) error {
}
// set hostname
if err := syscall.Sethostname([]byte(hostname)); err != nil {
return err
}
return nil
return syscall.Sethostname([]byte(hostname))
}
func SyncHostname() error {
@@ -55,9 +51,5 @@ func SyncHostname() error {
}
hostsContent += line + "\n"
}
if err := ioutil.WriteFile("/etc/hosts", []byte(hostsContent), 0600); err != nil {
return err
}
return nil
return ioutil.WriteFile("/etc/hosts", []byte(hostsContent), 0600)
}