Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change gc runtime name to go #2560

Merged
merged 2 commits into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 6 additions & 1 deletion sdk/resource/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
MadVikingGod marked this conversation as resolved.
Show resolved Hide resolved
defaultRuntimeVersionProvider runtimeVersionProvider = runtime.Version
defaultRuntimeOSProvider runtimeOSProvider = func() string { return runtime.GOOS }
defaultRuntimeArchProvider runtimeArchProvider = func() string { return runtime.GOARCH }
Expand Down
6 changes: 5 additions & 1 deletion sdk/resource/process_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
MrAlias marked this conversation as resolved.
Show resolved Hide resolved
require.EqualValues(t, "go", resource.RuntimeName())
} else {
require.EqualValues(t, runtime.Compiler, resource.RuntimeName())
}
}

func TestRuntimeOS(t *testing.T) {
Expand Down