diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-11-15 16:58:48 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-11-15 16:58:48 -0800 |
| commit | 95c0de285d907cbd826ba6ce97f7c4994c16ffd5 (patch) | |
| tree | 2ef04241b575b8169bf6b1baa2dd15cda4046be7 /weed/util/retry.go | |
| parent | 500bcab9535835404d29b8f68a03bf2ecf5b2991 (diff) | |
| download | seaweedfs-95c0de285d907cbd826ba6ce97f7c4994c16ffd5.tar.xz seaweedfs-95c0de285d907cbd826ba6ce97f7c4994c16ffd5.zip | |
refactoring
Diffstat (limited to 'weed/util/retry.go')
| -rw-r--r-- | weed/util/retry.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/weed/util/retry.go b/weed/util/retry.go index faaab0351..85c4d150d 100644 --- a/weed/util/retry.go +++ b/weed/util/retry.go @@ -29,3 +29,13 @@ func Retry(name string, job func() error) (err error) { } return err } + +// return the first non empty string +func Nvl(values ...string) string { + for _, s := range values { + if s != "" { + return s + } + } + return "" +} |
