1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-08-10 22:31:50 +02:00

sdk/trace: remove unused version function (#7036)

The unexported `version()` function in `sdk/trace` is not used anywhere.
Not mentioning that the value it is returning is wrong.

There is already a `Version` function in `sdk` (which is in the same Go
module).
This commit is contained in:
Robert Pająk
2025-07-16 20:24:48 +02:00
committed by GitHub
parent 0485596876
commit a6782b9ca9
2 changed files with 0 additions and 30 deletions

View File

@@ -1,9 +0,0 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package trace // import "go.opentelemetry.io/otel/sdk/trace"
// version is the current release version of the metric SDK in use.
func version() string {
return "1.16.0-rc.1"
}

View File

@@ -1,21 +0,0 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package trace
import (
"regexp"
"testing"
"github.com/stretchr/testify/assert"
)
var versionRegex = regexp.MustCompile(`^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)` +
`(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)` +
`(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?` +
`(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`)
func TestVersionSemver(t *testing.T) {
v := version()
assert.Regexp(t, versionRegex, v)
}