Skip to content

Commit

Permalink
Go: Use Toolchain directives in go.mod files, if available
Browse files Browse the repository at this point in the history
  • Loading branch information
mbg committed Jun 7, 2024
1 parent 9375d2e commit f02fb47
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions go/extractor/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ type GoModule struct {

// Tries to find the Go toolchain version required for this module.
func (module *GoModule) RequiredGoVersion() util.SemVer {
if module.Module != nil && module.Module.Toolchain != nil {
return util.NewSemVer(module.Module.Toolchain.Name)
}
if module.Module != nil && module.Module.Go != nil {
return util.NewSemVer(module.Module.Go.Version)
} else {
Expand Down

0 comments on commit f02fb47

Please sign in to comment.