MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / _infer_go_version

Function _infer_go_version

pre_commit/languages/golang.py:89–93  ·  view source on GitHub ↗
(version: str)

Source from the content-addressed store, hash-verified

87
88@functools.lru_cache
89def _infer_go_version(version: str) -> str:
90 if version != C.DEFAULT:
91 return version
92 resp = urllib.request.urlopen('https://go.dev/dl/?mode=json')
93 return json.load(resp)[0]['version'].removeprefix('go')
94
95
96def _get_url(version: str) -> str:

Callers 1

_get_urlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected