MCPcopy Create free account
hub / github.com/apache/fory / _normalize_go_version

Function _normalize_go_version

ci/release.py:960–978  ·  view source on GitHub ↗
(v: str)

Source from the content-addressed store, hash-verified

958
959
960def _normalize_go_version(v: str) -> str:
961 v = v.strip()
962 if v.startswith("v"):
963 v = v[1:]
964 v = re.sub(r"-(alpha|beta|rc)(\d+)$", r"-\1.\2", v)
965 if re.search(r"(?i)-(alpha|beta)\.0$", v):
966 return f"v{v}"
967 if re.search(r"(?i)-(alpha|beta|rc)\.\d+$", v):
968 return f"v{v}"
969 if re.search(r"(?i)-pre$", v):
970 return f"v{v}"
971 dev_match = re.search(r"(?i)(?:-dev|\.dev)(\d+)$", v)
972 if dev_match:
973 base = re.sub(r"(?i)(?:-dev|\.dev)\d+$", "", v)
974 return f"v{base}-alpha.{dev_match.group(1)}"
975 if re.search(r"(?i)(-snapshot|\.dev|-dev)$", v):
976 base = re.sub(r"(?i)(-snapshot|\.dev|-dev)$", "", v)
977 return f"v{base}-alpha.0"
978 return f"v{v}"
979
980
981def _normalize_cmake_version(v: str) -> str:

Callers 1

_update_go_mod_versionFunction · 0.85

Calls 1

subMethod · 0.45

Tested by

no test coverage detected