Merge branch 'patch-3' of https://github.com/dakerfp/grafana into dakerfp-patch-3

This commit is contained in:
bergquist 2016-06-03 15:02:46 +02:00
commit d1a345bb03

View File

@ -1,18 +1,18 @@
package util
func StringsFallback2(val1 string, val2 string) string {
if val1 != "" {
return val1
}
return val2
return stringsFallback(val1, val2)
}
func StringsFallback3(val1 string, val2 string, val3 string) string {
if val1 != "" {
return val1
}
if val2 != "" {
return val2
}
return val3
return stringsFallback(val1, val2, val3)
}
func stringsFallback(vals ...string) string {
for _, v := range vals {
if v != "" {
return v
}
}
return ""
}