Skip to content

Commit 91ab717

Browse files
authored
Nested if can be replaced with else-if (#27)
Signed-off-by: arcolife <archit.py@gmail.com>
1 parent 56bc14a commit 91ab717

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

model/unmarshal_json.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ func getBytesFromFile(s string) (b []byte, err error) {
3939
}
4040
if strings.HasPrefix(s, prefix) {
4141
s = strings.TrimPrefix(s, prefix)
42-
} else {
43-
if s, err = filepath.Abs(s); err != nil {
44-
return nil, err
45-
}
42+
} else if s, err = filepath.Abs(s); err != nil {
43+
return nil, err
4644
}
4745
if b, err = ioutil.ReadFile(filepath.Clean(s)); err != nil {
4846
return nil, err

0 commit comments

Comments
 (0)