mirror of
https://github.com/grafana/grafana.git
synced 2024-11-27 19:30:36 -06:00
Merge branch 'patch-3' of https://github.com/dakerfp/grafana into dakerfp-patch-3
This commit is contained in:
commit
d1a345bb03
@ -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 ""
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user