Skip to content

Commit 38d5f53

Browse files
committed
refactor: use maps.Copy for cleaner map handling
Signed-off-by: gopherorg <[email protected]>
1 parent b1874b6 commit 38d5f53

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Improvements
66
- [#1169](https://github.com/crypto-org-chain/chain-main/pull/1169) Update linter and tidy up code
7+
- [#1170](https://github.com/crypto-org-chain/chain-main/pull/1170) Use maps.Copy for cleaner map handling
78

89
*July 9, 2025*
910

app/app.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
"io"
88
"io/fs"
9+
"maps"
910
"net/http"
1011
"os"
1112
"path/filepath"
@@ -1010,9 +1011,7 @@ func RegisterSwaggerAPI(ctx client.Context, rtr *mux.Router) {
10101011
// GetMaccPerms returns a copy of the module account permissions
10111012
func GetMaccPerms() map[string][]string {
10121013
dupMaccPerms := make(map[string][]string)
1013-
for k, v := range maccPerms {
1014-
dupMaccPerms[k] = v
1015-
}
1014+
maps.Copy(dupMaccPerms, maccPerms)
10161015
return dupMaccPerms
10171016
}
10181017

0 commit comments

Comments
 (0)