diff --git a/pkg/disk/type_linux.go b/pkg/disk/type_linux.go index 98dceb66f..7de259a3c 100644 --- a/pkg/disk/type_linux.go +++ b/pkg/disk/type_linux.go @@ -40,7 +40,7 @@ var fsType2StringMap = map[string]string{ func getFSType(ftype int64) string { fsTypeHex := strconv.FormatInt(ftype, 16) fsTypeString, ok := fsType2StringMap[fsTypeHex] - if ok == false { + if !ok { return "UNKNOWN" } return fsTypeString diff --git a/pkg/madmin/api.go b/pkg/madmin/api.go index 2bf06b8b6..ef010583b 100644 --- a/pkg/madmin/api.go +++ b/pkg/madmin/api.go @@ -1,5 +1,5 @@ /* - * Minio Cloud Storage, (C) 2016 Minio, Inc. + * Minio Cloud Storage, (C) 2016, 2017 Minio, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -276,12 +276,7 @@ func (c AdminClient) dumpHTTP(req *http.Request, resp *http.Response) error { // Ends the http dump. _, err = fmt.Fprintln(c.traceOutput, "---------END-HTTP---------") - if err != nil { - return err - } - - // Returns success. - return nil + return err } // do - execute http request. diff --git a/pkg/madmin/heal-commands.go b/pkg/madmin/heal-commands.go index 7544a8f89..3dea72ccf 100644 --- a/pkg/madmin/heal-commands.go +++ b/pkg/madmin/heal-commands.go @@ -211,10 +211,7 @@ func (adm *AdminClient) listObjectsHeal(bucket, prefix, marker, delimiter string } err = xml.NewDecoder(resp.Body).Decode(&toBeHealedObjects) - if err != nil { - return toBeHealedObjects, err - } - return toBeHealedObjects, nil + return toBeHealedObjects, err } // ListObjectsHeal - Lists upto maxKeys objects that needing heal matching bucket, prefix, marker, delimiter. diff --git a/pkg/mimedb/db_test.go b/pkg/mimedb/db_test.go index 7ef73b65c..957e558db 100644 --- a/pkg/mimedb/db_test.go +++ b/pkg/mimedb/db_test.go @@ -1,5 +1,5 @@ /* - * mime-db: Mime Database, (C) 2015, 2016 Minio, Inc. + * mime-db: Mime Database, (C) 2015, 2016, 2017 Minio, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ func TestMimeLookup(t *testing.T) { t.Fatalf("Invalid content type are found expected \"application/x-msdownload\", got %s", contentType) } compressible := DB["txt"].Compressible - if compressible != false { + if compressible { t.Fatalf("Invalid content type are found expected \"false\", got %t", compressible) } } diff --git a/pkg/quick/encoding.go b/pkg/quick/encoding.go index c8a3a3b6d..2d2060a55 100644 --- a/pkg/quick/encoding.go +++ b/pkg/quick/encoding.go @@ -122,8 +122,7 @@ func saveFileConfig(filename string, v interface{}) error { // decoder format according to the filename extension. If no // extension is provided, json will be selected by default. func loadFileConfig(filename string, v interface{}) error { - _, err := os.Stat(filename) - if err != nil { + if _, err := os.Stat(filename); err != nil { return err } fileData, err := ioutil.ReadFile(filename) @@ -133,10 +132,6 @@ func loadFileConfig(filename string, v interface{}) error { if runtime.GOOS == "windows" { fileData = []byte(strings.Replace(string(fileData), "\r\n", "\n", -1)) } - ext := filepath.Ext(filename) // Unmarshal file's content - if err := toUnmarshaller(ext)(fileData, v); err != nil { - return err - } - return nil + return toUnmarshaller(filepath.Ext(filename))(fileData, v) }