all: simplify and clean up
This patch modernizes the for-range-loop code to copy a map with "maps.Clone" and "maps.Copy", also eliminates "copyFloats" with "slices.Clone". Also simplify "aggSort" and "sortMap" with slices and maps functions. Signed-off-by: Jes Cok <xigua67damn@gmail.com>
This commit is contained in:
@ -18,6 +18,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"maps"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@ -118,9 +119,7 @@ func testJWTInfo(t *testing.T, opts map[string]string) {
|
||||
if opts["pub-key"] != "" && opts["priv-key"] != "" {
|
||||
t.Run("verify-only", func(t *testing.T) {
|
||||
newOpts := make(map[string]string, len(opts))
|
||||
for k, v := range opts {
|
||||
newOpts[k] = v
|
||||
}
|
||||
maps.Copy(newOpts, opts)
|
||||
delete(newOpts, "priv-key")
|
||||
verify, err := newTokenProviderJWT(lg, newOpts)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user