fix: Better printing of XL config init error (#5284)

This commit is contained in:
A. Elleuch
2017-12-28 18:32:48 +01:00
committed by Nitish Tiwari
parent e3d841ffd1
commit 2244adff07
16 changed files with 151 additions and 61 deletions

View File

@@ -29,6 +29,7 @@ import (
"net/http"
"net/url"
"os"
"reflect"
"strings"
"time"
@@ -132,10 +133,13 @@ func isMaxPartID(partID int) bool {
return partID > globalMaxPartID
}
func contains(stringList []string, element string) bool {
for _, e := range stringList {
if e == element {
return true
func contains(slice interface{}, elem interface{}) bool {
v := reflect.ValueOf(slice)
if v.Kind() == reflect.Slice {
for i := 0; i < v.Len(); i++ {
if v.Index(i).Interface() == elem {
return true
}
}
}
return false