Replace usages of x/exp/maps + bump golang.org/x/exp (#5221)

Bump golang.org/x/exp; replace usages of x/exp/maps with stdlib equivalents
This commit is contained in:
Joe Kralicky 2024-08-15 17:49:24 -04:00 committed by GitHub
parent c8d0c87c17
commit 332932b7a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 126 additions and 118 deletions

View file

@ -1,9 +1,8 @@
package health
import (
"maps"
"sync"
"golang.org/x/exp/maps"
)
var _ Provider = (*deduplicator)(nil)

View file

@ -7,12 +7,12 @@ import (
"context"
"errors"
"fmt"
"maps"
"net/http"
"net/url"
"strings"
"github.com/go-jose/go-jose/v3/jwt"
"golang.org/x/exp/maps"
"golang.org/x/oauth2"
"github.com/pomerium/pomerium/internal/httputil"

View file

@ -5,7 +5,6 @@ import (
"fmt"
"strings"
"golang.org/x/exp/maps"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/types/known/fieldmaskpb"
@ -50,7 +49,7 @@ func (t *fieldMaskTree) addFieldPath(path string) {
}
node = m
}
maps.Clear(node)
clear(node)
}
// ErrDescriptorMismatch indicates an operation could not be performed because

View file

@ -4,14 +4,14 @@ package inmemory
import (
"context"
"fmt"
"sort"
"maps"
"slices"
"sync"
"sync/atomic"
"time"
"github.com/google/btree"
"github.com/rs/zerolog"
"golang.org/x/exp/maps"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/fieldmaskpb"
"google.golang.org/protobuf/types/known/timestamppb"
@ -206,8 +206,7 @@ func (backend *Backend) ListTypes(_ context.Context) ([]string, error) {
keys := maps.Keys(backend.lookup)
backend.mu.Unlock()
sort.Strings(keys)
return keys, nil
return slices.Sorted(keys), nil
}
// Put puts a record into the in-memory store.