You've already forked opentelemetry-go
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:
@@ -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"
|
|
||||||
}
|
|
@@ -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)
|
|
||||||
}
|
|
Reference in New Issue
Block a user