Skip to content

Commit

Permalink
internal/pkg/process: fix to trim GOEXPERIMENT suffix
Browse files Browse the repository at this point in the history
Signed-off-by: Koichi Shiraishi <[email protected]>
  • Loading branch information
zchee committed Oct 20, 2023
1 parent b4736c4 commit dc4beee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
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
- 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 {
vers = vers[:idx]
}
return version.NewVersion(vers)
}

Expand Down

0 comments on commit dc4beee

Please sign in to comment.