From 58ff64fb671070b4aac482723aa7e5c8e69d1946 Mon Sep 17 00:00:00 2001 From: pengbanban Date: Tue, 24 Dec 2024 18:08:52 +0800 Subject: [PATCH] refactor: using maps.Clone Signed-off-by: pengbanban --- test/pfm/simapp.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/pfm/simapp.go b/test/pfm/simapp.go index 398fe8604b..4bd0e4eb5b 100644 --- a/test/pfm/simapp.go +++ b/test/pfm/simapp.go @@ -3,6 +3,7 @@ package pfm import ( "encoding/json" "io" + "maps" "net/http" "os" "path/filepath" @@ -805,10 +806,7 @@ func RegisterSwaggerAPI(_ client.Context, rtr *mux.Router) { // GetMaccPerms returns a copy of the module account permissions func GetMaccPerms() map[string][]string { - dupMaccPerms := make(map[string][]string) - for k, v := range maccPerms { - dupMaccPerms[k] = v - } + dupMaccPerms := maps.Clone(maccPerms) return dupMaccPerms }