Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions dagsync/selector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ func TestGetRecursionLimit(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
gotLimit, gotFound := getRecursionLimit(tt.givenSelector)
require.Equal(t, tt.wantFound, gotFound)
Expand Down Expand Up @@ -159,7 +158,6 @@ func TestWithRecursionLimit(t *testing.T) {
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
gotSelector, gotApplied := withRecursionLimit(tt.givenSelector, tt.givenLimit)
require.Equal(t, tt.wantApplied, gotApplied)
Expand Down
9 changes: 2 additions & 7 deletions dagsync/subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"slices"
"sync"
"sync/atomic"
"time"
Expand Down Expand Up @@ -757,13 +758,7 @@ func delNotPresent(peerStore peerstore.Peerstore, peerID peer.ID, addrs []multia
var del []multiaddr.Multiaddr
oldAddrs := peerStore.Addrs(peerID)
for _, old := range oldAddrs {
keep := false
for _, new := range addrs {
if old.Equal(new) {
keep = true
break
}
}
keep := slices.ContainsFunc(addrs, old.Equal)
if !keep {
del = append(del, old)
}
Expand Down
4 changes: 2 additions & 2 deletions dagsync/subscriber_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func TestConcurrentSync(t *testing.T) {

subHost := test.MkTestHost(t)

for i := 0; i < publisherCount; i++ {
for range publisherCount {
ds := dssync.MutexWrap(datastore.NewMapDatastore())
pubHost, privKey := test.MkTestHostPK(t)

Expand Down Expand Up @@ -692,7 +692,7 @@ func TestMaxAsyncSyncs(t *testing.T) {
close(release2)
}

for i := 0; i < 2; i++ {
for range 2 {
select {
case <-timer.C:
t.Fatal("timed out waiting for sync")
Expand Down
4 changes: 2 additions & 2 deletions find/model/provider_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type ProviderInfo struct {
AddrInfo peer.AddrInfo
// LastAdvertisement identifies the latest advertisement the indexer has
// ingested.
LastAdvertisement cid.Cid `json:",omitempty"`
LastAdvertisement cid.Cid
// LastAdvertisementTime is the time the latest advertisement was received.
LastAdvertisementTime string `json:",omitempty"`
// Lag is the current sync lag for this provider. A non-zero lag tells us
Expand All @@ -29,7 +29,7 @@ type ProviderInfo struct {
ExtendedProviders *ExtendedProviders `json:",omitempty"`
// FrozenAt identifies the last advertisement that was received before the
// indexer became frozen.
FrozenAt cid.Cid `json:",omitempty"`
FrozenAt cid.Cid
// FrozenAtTime is the time that the FrozenAt advertisement was received.
FrozenAtTime string `json:",omitempty"`
// Inactive means that no update has been received for the configured
Expand Down
18 changes: 9 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/ipni/go-libipni
go 1.24.6

require (
github.com/gammazero/chanqueue v1.1.1
github.com/gammazero/chanqueue v1.1.2
github.com/hashicorp/go-retryablehttp v0.7.8
github.com/ipfs/go-cid v0.6.0
github.com/ipfs/go-datastore v0.9.0
Expand All @@ -21,7 +21,7 @@ require (
github.com/multiformats/go-varint v0.1.0
github.com/stretchr/testify v1.11.1
github.com/whyrusleeping/cbor-gen v0.3.1
golang.org/x/crypto v0.47.0
golang.org/x/crypto v0.48.0
google.golang.org/protobuf v1.36.11
)

Expand All @@ -35,7 +35,7 @@ require (
github.com/dunglas/httpsfv v1.1.0 // indirect
github.com/filecoin-project/go-clock v0.1.0 // indirect
github.com/flynn/noise v1.1.0 // indirect
github.com/gammazero/deque v1.1.0 // indirect
github.com/gammazero/deque v1.2.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f // indirect
Expand Down Expand Up @@ -106,14 +106,14 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.1 // indirect
golang.org/x/exp v0.0.0-20250813145105-42675adae3e6 // indirect
golang.org/x/mod v0.31.0 // indirect
golang.org/x/net v0.48.0 // indirect
golang.org/x/mod v0.32.0 // indirect
golang.org/x/net v0.49.0 // indirect
golang.org/x/sync v0.19.0 // indirect
golang.org/x/sys v0.40.0 // indirect
golang.org/x/telemetry v0.0.0-20251203150158-8fff8a5912fc // indirect
golang.org/x/text v0.33.0 // indirect
golang.org/x/sys v0.41.0 // indirect
golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2 // indirect
golang.org/x/text v0.34.0 // indirect
golang.org/x/time v0.12.0 // indirect
golang.org/x/tools v0.40.0 // indirect
golang.org/x/tools v0.41.0 // indirect
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/blake3 v1.4.1 // indirect
Expand Down
36 changes: 18 additions & 18 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg=
github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/gammazero/chanqueue v1.1.1 h1:n9Y+zbBxw2f7uUE9wpgs0rOSkP/I/yhDLiNuhyVjojQ=
github.com/gammazero/chanqueue v1.1.1/go.mod h1:fMwpwEiuUgpab0sH4VHiVcEoji1pSi+EIzeG4TPeKPc=
github.com/gammazero/deque v1.1.0 h1:OyiyReBbnEG2PP0Bnv1AASLIYvyKqIFN5xfl1t8oGLo=
github.com/gammazero/deque v1.1.0/go.mod h1:JVrR+Bj1NMQbPnYclvDlvSX0nVGReLrQZ0aUMuWLctg=
github.com/gammazero/chanqueue v1.1.2 h1:dZEsxlyANZMyeTRemABqZF8QM9BnE4NBI43Oh3y5fIU=
github.com/gammazero/chanqueue v1.1.2/go.mod h1:XDN1X/jjAbmSceNFOQbtKToeSkxtdVdpKu90LiEdBEE=
github.com/gammazero/deque v1.2.1 h1:9fnQVFCCZ9/NOc7ccTNqzoKd1tCWOqeI05/lPqFPMGQ=
github.com/gammazero/deque v1.2.1/go.mod h1:5nSFkzVm+afG9+gy0VIowlqVAW4N8zNcMne+CMQVD2g=
github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
Expand Down Expand Up @@ -272,16 +272,16 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE=
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8=
golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A=
golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts=
golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos=
golang.org/x/exp v0.0.0-20250813145105-42675adae3e6 h1:SbTAbRFnd5kjQXbczszQ0hdk3ctwYf3qBNH9jIsGclE=
golang.org/x/exp v0.0.0-20250813145105-42675adae3e6/go.mod h1:4QTo5u+SEIbbKW1RacMZq1YEfOBqeXa19JeshGi+zc4=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.31.0 h1:HaW9xtz0+kOcWKwli0ZXy79Ix+UW/vOfmWI5QVd2tgI=
golang.org/x/mod v0.31.0/go.mod h1:43JraMp9cGx1Rx3AqioxrbrhNsLl2l/iNAvuBkrezpg=
golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c=
golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
Expand All @@ -295,8 +295,8 @@ golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=
golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=
golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o=
golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand All @@ -319,10 +319,10 @@ golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/telemetry v0.0.0-20251203150158-8fff8a5912fc h1:bH6xUXay0AIFMElXG2rQ4uiE+7ncwtiOdPfYK1NK2XA=
golang.org/x/telemetry v0.0.0-20251203150158-8fff8a5912fc/go.mod h1:hKdjCMrbv9skySur+Nek8Hd0uJ0GuxJIoIX2payrIdQ=
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2 h1:O1cMQHRfwNpDfDJerqRoE2oD+AFlyid87D40L/OkkJo=
golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2/go.mod h1:b7fPSJ0pKZ3ccUh8gnTONJxhn3c/PS6tyzQvyqw4iA8=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
Expand All @@ -337,8 +337,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE=
golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8=
golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk=
golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA=
golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand All @@ -348,8 +348,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA=
golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc=
golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc=
golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
2 changes: 1 addition & 1 deletion ingest/schema/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (e EntryChunk) ToNode() (n ipld.Node, err error) {
return
}

func toError(r interface{}) error {
func toError(r any) error {
switch x := r.(type) {
case string:
return errors.New(x)
Expand Down
2 changes: 1 addition & 1 deletion ingest/schema/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type testSchema struct {
typeSystem *ipldSchema.TypeSystem
}

func createTestSchema(t *testing.T, schemaBytes []byte, adInterfacePtr interface{}) *testSchema {
func createTestSchema(t *testing.T, schemaBytes []byte, adInterfacePtr any) *testSchema {
ts := &testSchema{
linkproto: cidlink.LinkPrototype{
Prefix: cid.Prefix{
Expand Down
2 changes: 1 addition & 1 deletion mautil/mautil.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func MultiaddrsEqual(ma1, ma2 []multiaddr.Multiaddr) bool {
// Use slices package, as sort function does not allocate (sort.Slice does).
slices.SortFunc(ma1, func(a, b multiaddr.Multiaddr) int { return bytes.Compare(a.Bytes(), b.Bytes()) })
slices.SortFunc(ma2, func(a, b multiaddr.Multiaddr) int { return bytes.Compare(a.Bytes(), b.Bytes()) })
for i := 0; i < len(ma1); i++ {
for i := range ma1 {
if !ma1[i].Equal(ma2[i]) {
return false
}
Expand Down
5 changes: 2 additions & 3 deletions metadata/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"io"
"maps"
"sort"

"github.com/multiformats/go-multicodec"
Expand Down Expand Up @@ -74,9 +75,7 @@ func (mc *metadataContext) WithProtocol(id multicodec.Code, factory func() Proto
derived := metadataContext{
protocols: make(map[multicodec.Code]func() Protocol),
}
for k, v := range mc.protocols {
derived.protocols[k] = v
}
maps.Copy(derived.protocols, mc.protocols)
derived.protocols[id] = factory
return &derived
}
Expand Down
2 changes: 1 addition & 1 deletion p2pclient/message_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type bufferedDelimitedWriter struct {
}

var writerPool = sync.Pool{
New: func() interface{} {
New: func() any {
w := bufio.NewWriter(nil)
return &bufferedDelimitedWriter{
Writer: w,
Expand Down
9 changes: 3 additions & 6 deletions pcache/provider_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"context"
"errors"
"maps"
"net/http"
"sync/atomic"
"time"
Expand Down Expand Up @@ -324,9 +325,7 @@ func (pc *ProviderCache) Refresh(ctx context.Context) error {

// Shallow-copy update map.
updates := make(map[peer.ID]*readProviderInfo, len(read.u))
for pid, rpi := range read.u {
updates[pid] = rpi
}
maps.Copy(updates, read.u)

for pid, cinfo := range pc.write {
if cinfo.seq != seq {
Expand Down Expand Up @@ -486,9 +485,7 @@ func (pc *ProviderCache) fetchMissing(ctx context.Context, pid peer.ID) (*readPr

// Regenerate and add to extended read map.
updates := make(map[peer.ID]*readProviderInfo, len(read.u)+1)
for id, rpi := range read.u {
updates[id] = rpi
}
maps.Copy(updates, read.u)
rpinfo := apiToCacheInfo(cinfo.provider)
updates[pid] = rpinfo

Expand Down
11 changes: 5 additions & 6 deletions rwriter/response_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"mime"
"net/http"
"path"
"slices"
"strings"

"github.com/ipfs/go-cid"
Expand Down Expand Up @@ -43,8 +44,8 @@ func New(w http.ResponseWriter, r *http.Request, options ...Option) (*ResponseWr
accepts := r.Header.Values("Accept")
var nd, okJson bool
for _, accept := range accepts {
amts := strings.Split(accept, ",")
for _, amt := range amts {
amts := strings.SplitSeq(accept, ",")
for amt := range amts {
mt, _, err := mime.ParseMediaType(amt)
if err != nil {
return nil, apierror.New(errors.New("invalid Accept header"), http.StatusBadRequest)
Expand Down Expand Up @@ -187,10 +188,8 @@ func MatchQueryParam(r *http.Request, key, value string) (bool, bool) {
if !present {
return false, false
}
for _, label := range labels {
if label == value {
return true, true
}
if slices.Contains(labels, value) {
return true, true
}
return true, false
}