Skip to content

Commit

Permalink
Address gosec findings
Browse files Browse the repository at this point in the history
  • Loading branch information
tobischo committed Mar 11, 2024
1 parent dc40ca5 commit 88a57e8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion database.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ func addEntriesBinaries(result binariesUsages, entries []Entry) {
func addGroupBinaries(result binariesUsages, parent *Group) {
addEntriesBinaries(result, parent.Entries)
for _, group := range parent.Groups {
addGroupBinaries(result, &group)
g := group

addGroupBinaries(result, &g)
}
}

Expand Down
8 changes: 6 additions & 2 deletions group.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ func WithGroupFormattedTime(formatted bool) GroupOption {
WithTimeDataFormattedTime(formatted)(&g.Times)

for _, group := range g.Groups {
WithGroupFormattedTime(formatted)(&group)
g := group

WithGroupFormattedTime(formatted)(&g)
}

for _, entry := range g.Entries {
WithEntryFormattedTime(formatted)(&entry)
e := entry

WithEntryFormattedTime(formatted)(&e)
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion root_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ type RootDataOption func(*RootData)
func WithRootDataFormattedTime(formatted bool) RootDataOption {
return func(rd *RootData) {
for _, group := range rd.Groups {
WithGroupFormattedTime(formatted)(&group)
g := group

WithGroupFormattedTime(formatted)(&g)
}
}
}
Expand Down

0 comments on commit 88a57e8

Please sign in to comment.