fix sonar problem

* Delete FIXME comment, because `string == ""` is beter than `len(string)` for checking string existence(by sonar)
* Remove duplicated code
* Fill empty block of code
This commit is contained in:
t29kida
2021-06-08 23:06:19 +09:00
parent 18de06b970
commit 4eb19f938a
4 changed files with 5 additions and 34 deletions

View File

@@ -210,7 +210,6 @@ func (c *JSONConfigContainer) String(key string) (string, error) {
// DefaultString returns the string value for a given key.
// if err != nil return defaultval
func (c *JSONConfigContainer) DefaultString(key string, defaultVal string) string {
// TODO FIXME should not use "" to replace non existence
if v, err := c.String(key); v != "" && err == nil {
return v
}