Revert "Opportunities to unindent code (unindent)"

This commit is contained in:
Marcus Efraimsson
2018-05-02 14:06:46 +02:00
committed by GitHub
parent 6dcb9e696d
commit de0d409a23
8 changed files with 131 additions and 124 deletions
+4 -2
View File
@@ -168,8 +168,10 @@ func (j *Json) GetPath(branch ...string) *Json {
// js.Get("top_level").Get("array").GetIndex(1).Get("key").Int()
func (j *Json) GetIndex(index int) *Json {
a, err := j.Array()
if err == nil && len(a) > index {
return &Json{a[index]}
if err == nil {
if len(a) > index {
return &Json{a[index]}
}
}
return &Json{nil}
}