MCPcopy
hub / github.com/kubernetes/test-infra / OptionalAbsPath

Function OptionalAbsPath

kubetest/util/util.go:87–93  ·  view source on GitHub ↗

OptionalAbsPath returns an absolute path if the provided path wasn't empty, and otherwise returns an empty string.

(path string)

Source from the content-addressed store, hash-verified

85// OptionalAbsPath returns an absolute path if the provided path wasn't empty, and otherwise
86// returns an empty string.
87func OptionalAbsPath(path string) (string, error) {
88 if path == "" {
89 return "", nil
90 }
91
92 return filepath.Abs(path)
93}
94
95// JoinURL converts input (gs://foo, "bar") to gs://foo/bar
96func JoinURL(urlPath, path string) (string, error) {

Callers 1

runFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected