MCPcopy
hub / github.com/keploy/keploy / mustAbs

Function mustAbs

utils/grpc.go:209–221  ·  view source on GitHub ↗
(p string)

Source from the content-addressed store, hash-verified

207}
208
209func mustAbs(p string) (string, error) {
210 if p == "" {
211 return "", nil
212 }
213 if filepath.IsAbs(p) {
214 return filepath.Clean(p), nil
215 }
216 a, err := filepath.Abs(p)
217 if err != nil {
218 return "", fmt.Errorf("abs(%q): %v", p, err)
219 }
220 return filepath.Clean(a), nil
221}
222
223func containsDir(dirs []string, dir string) bool {
224 dir = filepath.Clean(dir)

Callers 2

deriveProtoDirFromPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected