Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bobgroup-go-utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bob Public Utils
bobgroup-go-utils
Commits
937d599e
Commit
937d599e
authored
3 years ago
by
Johan de Klerk
Browse files
Options
Downloads
Plain Diff
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
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
audit/audit.go
+5
-4
5 additions, 4 deletions
audit/audit.go
with
5 additions
and
4 deletions
audit/audit.go
+
5
−
4
View file @
937d599e
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment