diff --git a/audit/audit.go b/audit/audit.go index 51bd5ffb8770cf86b4b7c927289e67ebee8e8ccc..1ff39abc6c3af2287b77db1dd50bfb58970b2442 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