MCPcopy Index your code
hub / github.com/go-python/gopy / getGoVersion

Function getGoVersion

bind/utils.go:224–234  ·  view source on GitHub ↗
(version string)

Source from the content-addressed store, hash-verified

222}
223
224func getGoVersion(version string) (int64, int64, error) {
225 version_regex := regexp.MustCompile(`^go((\d+)(\.(\d+))*)`)
226 match := version_regex.FindStringSubmatch(version)
227 if match == nil {
228 return -1, -1, fmt.Errorf("gopy: invalid Go version information: %q", version)
229 }
230 version_info := strings.Split(match[1], ".")
231 major, _ := strconv.ParseInt(version_info[0], 10, 0)
232 minor, _ := strconv.ParseInt(version_info[1], 10, 0)
233 return major, minor, nil
234}
235
236var (
237 rxValidPythonName = regexp.MustCompile(`^[\pL_][\pL_\pN]+$`)

Callers 1

TestGetGoVersionFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestGetGoVersionFunction · 0.68