Added golangci-lint configuration and prepared for the integrattion

This commit is contained in:
Andrey Meshkov
2019-01-25 16:01:27 +03:00
committed by Eugene Bujak
parent 69a75fbcaa
commit ec6b1f7c42
13 changed files with 108 additions and 42 deletions

View File

@@ -101,9 +101,9 @@ func handleDHCPInterfaces(w http.ResponseWriter, r *http.Request) {
MTU: ifaces[i].MTU,
HardwareAddr: ifaces[i].HardwareAddr.String(),
}
addrs, err := ifaces[i].Addrs()
if err != nil {
httpError(w, http.StatusInternalServerError, "Failed to get addresses for interface %v: %s", ifaces[i].Name, err)
addrs, errAddrs := ifaces[i].Addrs()
if errAddrs != nil {
httpError(w, http.StatusInternalServerError, "Failed to get addresses for interface %v: %s", ifaces[i].Name, errAddrs)
return
}
for _, addr := range addrs {
@@ -155,7 +155,7 @@ func handleDHCPFindActiveServer(w http.ResponseWriter, r *http.Request) {
}
func startDHCPServer() error {
if config.DHCP.Enabled == false {
if !config.DHCP.Enabled {
// not enabled, don't do anything
return nil
}