MCPcopy Create free account
hub / github.com/bufbuild/buf / NormalizeAndTransformForPathType

Function NormalizeAndTransformForPathType

private/pkg/normalpath/normalpath.go:125–134  ·  view source on GitHub ↗

NormalizeAndTransformForPathType calls NormalizeAndValidate for relative paths, and NormalizeAndAbsolute for absolute paths.

(path string, pathType PathType)

Source from the content-addressed store, hash-verified

123// NormalizeAndTransformForPathType calls NormalizeAndValidate for relative
124// paths, and NormalizeAndAbsolute for absolute paths.
125func NormalizeAndTransformForPathType(path string, pathType PathType) (string, error) {
126 switch pathType {
127 case Relative:
128 return NormalizeAndValidate(path)
129 case Absolute:
130 return NormalizeAndAbsolute(path)
131 default:
132 return "", fmt.Errorf("unknown PathType: %v", pathType)
133 }
134}
135
136// Unnormalize unnormalizes the given path.
137//

Callers

nothing calls this directly

Calls 2

NormalizeAndAbsoluteFunction · 0.85
NormalizeAndValidateFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…