MCPcopy
hub / github.com/apache/answer / versionedModulePath

Function versionedModulePath

internal/cli/build.go:608–621  ·  view source on GitHub ↗
(modulePath, moduleVersion string)

Source from the content-addressed store, hash-verified

606}
607
608func versionedModulePath(modulePath, moduleVersion string) string {
609 if moduleVersion == "" {
610 return modulePath
611 }
612 ver, err := semver.StrictNewVersion(strings.TrimPrefix(moduleVersion, "v"))
613 if err != nil {
614 return modulePath
615 }
616 major := ver.Major()
617 if major > 1 {
618 modulePath += fmt.Sprintf("/v%d", major)
619 }
620 return path.Clean(modulePath)
621}

Callers 1

createMainGoFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected