OptionalAbsPath returns an absolute path if the provided path wasn't empty, and otherwise returns an empty string.
(path string)
| 85 | // OptionalAbsPath returns an absolute path if the provided path wasn't empty, and otherwise |
| 86 | // returns an empty string. |
| 87 | func 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 |
| 96 | func JoinURL(urlPath, path string) (string, error) { |