Skip to content
Snippets Groups Projects
Commit 937d599e authored by Johan de Klerk's avatar Johan de Klerk
Browse files

Merge branch 'main' of gitlab.com:uafrica/go-utils

parents 472c3f48 ce321b9f
No related branches found
No related tags found
No related merge requests found
...@@ -2,13 +2,14 @@ package audit ...@@ -2,13 +2,14 @@ package audit
import ( import (
"encoding/json" "encoding/json"
"github.com/r3labs/diff/v2"
"gitlab.com/uafrica/go-utils/reflection"
"gitlab.com/uafrica/go-utils/string_utils"
"reflect" "reflect"
"regexp" "regexp"
"strconv" "strconv"
"strings" "strings"
"github.com/r3labs/diff/v2"
"gitlab.com/uafrica/go-utils/reflection"
"gitlab.com/uafrica/go-utils/string_utils"
) )
type FieldChange struct { type FieldChange struct {
...@@ -213,7 +214,7 @@ func GetAllChanges(original interface{}, new interface{}) (map[string]interface{ ...@@ -213,7 +214,7 @@ func GetAllChanges(original interface{}, new interface{}) (map[string]interface{
opener := changesJson[index+len(split)+2 : index+len(split)+3] opener := changesJson[index+len(split)+2 : index+len(split)+3]
// Prevent a "base level" key from matching a nested key // Prevent a "base level" key from matching a nested key
baseLevel := false baseLevel := false
if index >= 1 { if index > 1 {
containedBy := changesJson[index-1 : index] containedBy := changesJson[index-1 : index]
if levelsDeep == 0 && (containedBy == "{" || containedBy == "[") { if levelsDeep == 0 && (containedBy == "{" || containedBy == "[") {
baseLevel = true baseLevel = true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment