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

Parse Go versions that contain GOEXPERIMENT suffixes. #389

Merged
merged 3 commits into from
Oct 20, 2023
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ OpenTelemetry Go Automatic Instrumentation adheres to [Semantic Versioning](http

## [Unreleased]

### Fixed
MrAlias marked this conversation as resolved.
Show resolved Hide resolved
- Parse Go versions that contain `GOEXPERIMENT` suffixes. ([#389](https://github.com/open-telemetry/opentelemetry-go-instrumentation/pull/389))

## [v0.7.0-alpha] - 2023-10-15

### Added
Expand Down
4 changes: 4 additions & 0 deletions internal/pkg/process/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ func (a *Analyzer) getModuleDetails(f *elf.File) (*version.Version, map[string]s

func parseGoVersion(vers string) (*version.Version, error) {
vers = strings.ReplaceAll(vers, "go", "")
// Trims GOEXPERIMENT version suffix if present.
if idx := strings.Index(vers, " X:"); idx > 0 {
zchee marked this conversation as resolved.
Show resolved Hide resolved
vers = vers[:idx]
}
return version.NewVersion(vers)
}

Expand Down