hasMinimalMinorGoDirective indicates that the Go module (`mod`) has a minor version greater than or equal to the `expected`'s This only applies to the `go` directive: go 1.23 go 1.22.1
(expected int, mod *modfile.File)
| 72 | // go 1.23 |
| 73 | // go 1.22.1 |
| 74 | func hasMinimalMinorGoDirective(expected int, mod *modfile.File) bool { |
| 75 | parts := strings.Split(mod.Go.Version, ".") |
| 76 | |
| 77 | if len(parts) < 2 { |
| 78 | return false |
| 79 | } |
| 80 | |
| 81 | actual, err := strconv.Atoi(parts[1]) |
| 82 | if err != nil { |
| 83 | return false |
| 84 | } |
| 85 | |
| 86 | if actual < expected { |
| 87 | return false |
| 88 | } |
| 89 | |
| 90 | return true |
| 91 | } |