MCPcopy Index your code
hub / github.com/voidint/g / getGoDirective

Function getGoDirective

cli/use.go:95–102  ·  view source on GitHub ↗

getGoDirective Extract the go directive from the go.mod file.

(goModData []byte)

Source from the content-addressed store, hash-verified

93
94// getGoDirective Extract the go directive from the go.mod file.
95func getGoDirective(goModData []byte) string {
96 // https://go.dev/ref/mod#go-mod-file-go
97 match := goDirectiveReg.FindStringSubmatch(string(goModData))
98 if len(match) > 1 {
99 return match[1]
100 }
101 return ""
102}

Callers 2

useFunction · 0.85
TestGetGoDirectiveFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestGetGoDirectiveFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…