Skip to content

Commit 0a266f5

Browse files
committed
Change Version() function to const Version string in otelhttp (#8134)
1 parent b56f585 commit 0a266f5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,3 +1622,7 @@ First official tagged release of `contrib` repository.
16221622
[Go 1.18]: https://go.dev/doc/go1.18
16231623

16241624
[GO-2024-2687]: https://pkg.go.dev/vuln/GO-2024-2687
1625+
1626+
### Changed
1627+
1628+
- Change `Version()` function in `otelhttp` package to a `const Version` string. (#8134)

instrumentation/net/http/otelhttp/version_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ var versionRegex = regexp.MustCompile(`^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)
1919
`(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`)
2020

2121
func TestVersionSemver(t *testing.T) {
22-
v := otelhttp.Version()
22+
v := otelhttp.Version
2323
assert.NotNil(t, versionRegex.FindStringSubmatch(v), "version is not semver: %s", v)
2424
}

0 commit comments

Comments
 (0)