mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-01-30 04:40:41 +02:00
change gc
runtime name to go
(#2560)
Per the specification: https://github.com/open-telemetry/opentelemetry-specification/pull/2262 Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
parent
0a6e4d8218
commit
a15269a28a
@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||
- `OTEL_SPAN_LINK_COUNT_LIMIT`
|
||||
|
||||
If the provided environment variables are invalid (negative), the default values would be used.
|
||||
- Rename the `gc` runtime name to `go` (#2560)
|
||||
|
||||
### Changed
|
||||
|
||||
|
@ -39,7 +39,12 @@ var (
|
||||
defaultExecutablePathProvider executablePathProvider = os.Executable
|
||||
defaultCommandArgsProvider commandArgsProvider = func() []string { return os.Args }
|
||||
defaultOwnerProvider ownerProvider = user.Current
|
||||
defaultRuntimeNameProvider runtimeNameProvider = func() string { return runtime.Compiler }
|
||||
defaultRuntimeNameProvider runtimeNameProvider = func() string {
|
||||
if runtime.Compiler == "gc" {
|
||||
return "go"
|
||||
}
|
||||
return runtime.Compiler
|
||||
}
|
||||
defaultRuntimeVersionProvider runtimeVersionProvider = runtime.Version
|
||||
defaultRuntimeOSProvider runtimeOSProvider = func() string { return runtime.GOOS }
|
||||
defaultRuntimeArchProvider runtimeArchProvider = func() string { return runtime.GOARCH }
|
||||
|
@ -118,7 +118,11 @@ func TestCommandArgs(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestRuntimeName(t *testing.T) {
|
||||
require.EqualValues(t, runtime.Compiler, resource.RuntimeName())
|
||||
if runtime.Compiler == "gc" {
|
||||
require.EqualValues(t, "go", resource.RuntimeName())
|
||||
} else {
|
||||
require.EqualValues(t, runtime.Compiler, resource.RuntimeName())
|
||||
}
|
||||
}
|
||||
|
||||
func TestRuntimeOS(t *testing.T) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user