Files
Davanum Srinivas 0706a3bb89 Update k8s.io/kube-openapi to v0.0.0-20260721132016-d427ff9ee9ad
Picks up:
- kubernetes/kube-openapi#625: update the go-openapi/swag family to v0.27.1
- kubernetes/kube-openapi#622: propagate nullable field between SMD and OpenAPI schemas

Transitive dependency changes:
- github.com/go-openapi/swag (and submodules) v0.25.4 -> v0.27.1
- github.com/go-openapi/jsonpointer v0.22.4 -> v1.0.0
- github.com/go-openapi/jsonreference v0.21.4 -> v1.0.0
- github.com/go-openapi/swag/jsonname removed (package now provided by jsonpointer)
- github.com/go-openapi/swag/pools added

No changes to hack/unwanted-dependencies.json needed.
2026-07-21 09:56:05 -04:00

52 lines
1.5 KiB
Go

//go:build !poolsdebug
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0
package pools
// This is the release implementation of the pool instrumentation: it does
// nothing.
//
// tracker is an empty struct, so it adds no field to the pool types and its
// methods inline away to nothing.
//
// Build with -tags poolsdebug to get the instrumented variant (see
// debug_on.go).
// debugBuild reports whether the pool instrumentation is compiled in (the
// poolsdebug tag).
const debugBuild = false
// DebugBuild reports whether the pool instrumentation is compiled in (the
// poolsdebug build tag).
//
// It lets a test that must run in both modes skip the parts that are invalid
// under instrumentation — e.g. an allocation-count assertion, since the
// instrumented build allocates a per-borrow tracker.
const DebugBuild = debugBuild
type tracker[T any] struct{}
func (tracker[T]) register() {}
func (tracker[T]) onBorrow(*T) {}
func (tracker[T]) onRedeem(*T) {}
func (tracker[T]) borrowRedeemer(_ *T, cached func()) func() { return cached }
// AssertNoLeaks reports whether every borrowed object has been redeemed across
// all pools.
//
// It is only meaningful in the instrumented build (-tags poolsdebug).
//
// In a release build it is a no-op that always reports true, so the same test
// can run in both modes.
func AssertNoLeaks(TB) bool { return true }
// ResetTracking clears all recorded borrow/redeem tracking.
//
// This is a no-op in a release build.
func ResetTracking() {}