Skip to content

Commit

Permalink
remove x/exp
Browse files Browse the repository at this point in the history
maps.Values() is in the standard library now, except it returns an
iterator instead of a slice.
  • Loading branch information
majewsky committed Jan 10, 2025
1 parent 70955d4 commit 69292df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ package cache

import (
"encoding/json"
"maps"
"slices"
"sync"
"time"

"golang.org/x/exp/maps"

"github.com/sapcc/maintenance-controller/state"
)

Expand Down Expand Up @@ -58,5 +58,5 @@ func (nic *nodeInfoCacheImpl) JSON() ([]byte, error) {
// pointers, which in turn open up for data races
nic.mutex.Lock()
defer nic.mutex.Unlock()
return json.Marshal(maps.Values(nic.nodes))
return json.Marshal(slices.Collect(maps.Values(nic.nodes)))
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ require (
github.com/slack-go/slack v0.15.0
github.com/vmware/govmomi v0.47.0
go.uber.org/zap v1.27.0
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8
gopkg.in/ini.v1 v1.67.0
k8s.io/api v0.31.1
k8s.io/apimachinery v0.31.1
Expand Down Expand Up @@ -64,6 +63,7 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/oauth2 v0.24.0 // indirect
golang.org/x/sys v0.29.0 // indirect
Expand Down

0 comments on commit 69292df

Please sign in to comment.