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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bob Public Utils
bobgroup-go-utils
Merge requests
!27
Fix bug with audit logger
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Fix bug with audit logger
audit-logger-bugfixes
into
main
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Ruaan Burger
requested to merge
audit-logger-bugfixes
into
main
3 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
32a49438
1 commit,
3 years ago
1 file
+
5
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
audit/audit.go
+
5
−
4
View file @ 32a49438
Edit in single-file editor
Open in Web IDE
Show full file
@@ -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
Loading