chore: use exp/maps
This commit is contained in:
parent
9cb40c68be
commit
ea3f4e4c0d
1 changed files with 5 additions and 4 deletions
|
|
@ -1,6 +1,9 @@
|
|||
package profile
|
||||
|
||||
import "github.com/lorenzodonini/ocpp-go/ocpp1.6/core"
|
||||
import (
|
||||
"github.com/lorenzodonini/ocpp-go/ocpp1.6/core"
|
||||
"golang.org/x/exp/maps"
|
||||
)
|
||||
|
||||
// OnGetConfiguration handles the CS message
|
||||
func (s *Core) OnGetConfiguration(request *core.GetConfigurationRequest) (confirmation *core.GetConfigurationConfirmation, err error) {
|
||||
|
|
@ -20,9 +23,7 @@ func (s *Core) OnGetConfiguration(request *core.GetConfigurationRequest) (confir
|
|||
|
||||
// return config for all keys
|
||||
if len(request.Key) == 0 {
|
||||
for _, v := range s.configuration {
|
||||
resultKeys = append(resultKeys, v)
|
||||
}
|
||||
resultKeys = maps.Values(s.configuration)
|
||||
}
|
||||
|
||||
s.log.TRACE.Printf("%s: configuration for requested keys: %v", request.GetFeatureName(), request.Key)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue