mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-06-16 11:58:52 -04:00
Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.25.3 to 2.26.0. - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/ginkgo/compare/v2.25.3...v2.26.0) --- updated-dependencies: - dependency-name: github.com/onsi/ginkgo/v2 dependency-version: 2.26.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
38 lines
735 B
Go
38 lines
735 B
Go
package yaml
|
|
|
|
import "context"
|
|
|
|
type (
|
|
ctxMergeKey struct{}
|
|
ctxAnchorKey struct{}
|
|
)
|
|
|
|
func withMerge(ctx context.Context) context.Context {
|
|
return context.WithValue(ctx, ctxMergeKey{}, true)
|
|
}
|
|
|
|
func isMerge(ctx context.Context) bool {
|
|
v, ok := ctx.Value(ctxMergeKey{}).(bool)
|
|
if !ok {
|
|
return false
|
|
}
|
|
return v
|
|
}
|
|
|
|
func withAnchor(ctx context.Context, name string) context.Context {
|
|
anchorMap := getAnchorMap(ctx)
|
|
if anchorMap == nil {
|
|
anchorMap = make(map[string]struct{})
|
|
}
|
|
anchorMap[name] = struct{}{}
|
|
return context.WithValue(ctx, ctxAnchorKey{}, anchorMap)
|
|
}
|
|
|
|
func getAnchorMap(ctx context.Context) map[string]struct{} {
|
|
v, ok := ctx.Value(ctxAnchorKey{}).(map[string]struct{})
|
|
if !ok {
|
|
return nil
|
|
}
|
|
return v
|
|
}
|