MCPcopy Index your code
hub / github.com/oapi-codegen/oapi-codegen / hasMinimalMinorGoDirective

Function hasMinimalMinorGoDirective

pkg/codegen/minimum_go_version.go:74–91  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

72// go 1.23
73// go 1.22.1
74func 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}

Callers 1

warningForStdHTTPMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected