Bumps the minor-and-patch group with 10 updates in the / directory: | Package | From | To | | --- | --- | --- | | [github.com/nats-io/nats-server/v2](https://github.com/nats-io/nats-server) | `2.14.1` | `2.14.2` | | [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) | `2.29.0` | `2.31.0` | | [github.com/onsi/gomega](https://github.com/onsi/gomega) | `1.41.0` | `1.42.0` | | [github.com/open-policy-agent/opa](https://github.com/open-policy-agent/opa) | `1.16.2` | `1.17.1` | | [github.com/tus/tusd/v2](https://github.com/tus/tusd) | `2.9.2` | `2.10.0` | | [go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp](https://github.com/open-telemetry/opentelemetry-go-contrib) | `0.68.0` | `0.69.0` | | [go.opentelemetry.io/contrib/zpages](https://github.com/open-telemetry/opentelemetry-go-contrib) | `0.68.0` | `0.69.0` | | [golang.org/x/crypto](https://github.com/golang/crypto) | `0.52.0` | `0.53.0` | | [golang.org/x/image](https://github.com/golang/image) | `0.41.0` | `0.42.0` | | [golang.org/x/net](https://github.com/golang/net) | `0.55.0` | `0.56.0` | Updates `github.com/nats-io/nats-server/v2` from 2.14.1 to 2.14.2 - [Release notes](https://github.com/nats-io/nats-server/releases) - [Changelog](https://github.com/nats-io/nats-server/blob/main/RELEASES.md) - [Commits](https://github.com/nats-io/nats-server/compare/v2.14.1...v2.14.2) Updates `github.com/onsi/ginkgo/v2` from 2.29.0 to 2.31.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.29.0...v2.31.0) Updates `github.com/onsi/gomega` from 1.41.0 to 1.42.0 - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.41.0...v1.42.0) Updates `github.com/open-policy-agent/opa` from 1.16.2 to 1.17.1 - [Release notes](https://github.com/open-policy-agent/opa/releases) - [Changelog](https://github.com/open-policy-agent/opa/blob/v1.17.1/CHANGELOG.md) - [Commits](https://github.com/open-policy-agent/opa/compare/v1.16.2...v1.17.1) Updates `github.com/tus/tusd/v2` from 2.9.2 to 2.10.0 - [Release notes](https://github.com/tus/tusd/releases) - [Commits](https://github.com/tus/tusd/compare/v2.9.2...v2.10.0) Updates `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` from 0.68.0 to 0.69.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go-contrib/compare/zpages/v0.68.0...zpages/v0.69.0) Updates `go.opentelemetry.io/contrib/zpages` from 0.68.0 to 0.69.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-go-contrib/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-go-contrib/compare/zpages/v0.68.0...zpages/v0.69.0) Updates `golang.org/x/crypto` from 0.52.0 to 0.53.0 - [Commits](https://github.com/golang/crypto/compare/v0.52.0...v0.53.0) Updates `golang.org/x/image` from 0.41.0 to 0.42.0 - [Commits](https://github.com/golang/image/compare/v0.41.0...v0.42.0) Updates `golang.org/x/net` from 0.55.0 to 0.56.0 - [Commits](https://github.com/golang/net/compare/v0.55.0...v0.56.0) Updates `golang.org/x/sync` from 0.20.0 to 0.21.0 - [Commits](https://github.com/golang/sync/compare/v0.20.0...v0.21.0) Updates `golang.org/x/term` from 0.43.0 to 0.44.0 - [Commits](https://github.com/golang/term/compare/v0.43.0...v0.44.0) Updates `golang.org/x/text` from 0.37.0 to 0.38.0 - [Release notes](https://github.com/golang/text/releases) - [Commits](https://github.com/golang/text/compare/v0.37.0...v0.38.0) --- updated-dependencies: - dependency-name: github.com/nats-io/nats-server/v2 dependency-version: 2.14.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-and-patch - dependency-name: github.com/onsi/ginkgo/v2 dependency-version: 2.31.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: github.com/onsi/gomega dependency-version: 1.42.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: github.com/open-policy-agent/opa dependency-version: 1.17.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: github.com/tus/tusd/v2 dependency-version: 2.10.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp dependency-version: 0.69.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: go.opentelemetry.io/contrib/zpages dependency-version: 0.69.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: golang.org/x/crypto dependency-version: 0.53.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: golang.org/x/image dependency-version: 0.42.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: golang.org/x/net dependency-version: 0.56.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: golang.org/x/sync dependency-version: 0.21.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: golang.org/x/term dependency-version: 0.44.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: golang.org/x/text dependency-version: 0.38.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
59 lines
1.2 KiB
Go
59 lines
1.2 KiB
Go
// Copyright 2016 The OPA Authors. All rights reserved.
|
|
// Use of this source code is governed by an Apache2
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package ast
|
|
|
|
import (
|
|
"reflect"
|
|
"strings"
|
|
)
|
|
|
|
// TypeName returns a human readable name for the AST element type.
|
|
func TypeName(x any) string {
|
|
if _, ok := x.(*lazyObj); ok {
|
|
return "object"
|
|
}
|
|
return strings.ToLower(reflect.Indirect(reflect.ValueOf(x)).Type().Name())
|
|
}
|
|
|
|
// ValueName returns a human readable name for the AST Value type.
|
|
// This is preferrable over calling TypeName when the argument is known to be
|
|
// a Value, as this doesn't require reflection (= heap allocations).
|
|
func ValueName(x Value) string {
|
|
switch x.(type) {
|
|
case String:
|
|
return "string"
|
|
case Boolean:
|
|
return "boolean"
|
|
case Number:
|
|
return "number"
|
|
case Null:
|
|
return "null"
|
|
case Var:
|
|
return "var"
|
|
case Object:
|
|
return "object"
|
|
case Set:
|
|
return "set"
|
|
case Ref:
|
|
return "ref"
|
|
case Call:
|
|
return "call"
|
|
case *Array:
|
|
return "array"
|
|
case *ArrayComprehension:
|
|
return "arraycomprehension"
|
|
case *ObjectComprehension:
|
|
return "objectcomprehension"
|
|
case *SetComprehension:
|
|
return "setcomprehension"
|
|
case *TemplateString:
|
|
return "templatestring"
|
|
case *Not:
|
|
return "not"
|
|
}
|
|
|
|
return TypeName(x)
|
|
}
|