diff --git a/audit/audit.go b/audit/audit.go index 6dff2b1d2b9a8b7c4c48439203d31b73c41a2577..f4cab139648398977e97b19236c4a25d1fcdd15d 100644 --- a/audit/audit.go +++ b/audit/audit.go @@ -2,13 +2,14 @@ package audit import ( "encoding/json" - "github.com/r3labs/diff/v2" - "gitlab.com/uafrica/go-utils/reflection" - "gitlab.com/uafrica/go-utils/string_utils" "reflect" "regexp" "strconv" "strings" + + "github.com/r3labs/diff/v2" + "gitlab.com/uafrica/go-utils/reflection" + "gitlab.com/uafrica/go-utils/string_utils" ) type FieldChange struct { @@ -213,7 +214,7 @@ func GetAllChanges(original interface{}, new interface{}) (map[string]interface{ opener := changesJson[index+len(split)+2 : index+len(split)+3] // Prevent a "base level" key from matching a nested key baseLevel := false - if index >= 1 { + if index > 1 { containedBy := changesJson[index-1 : index] if levelsDeep == 0 && (containedBy == "{" || containedBy == "[") { baseLevel = true