MCPcopy
hub / github.com/firecracker-microvm/firecracker-containerd / relPathTo

Function relPathTo

internal/vm/dir.go:179–191  ·  view source on GitHub ↗
(absPath string)

Source from the content-addressed store, hash-verified

177}
178
179func relPathTo(absPath string) (string, error) {
180 cwd, err := os.Getwd()
181 if err != nil {
182 return "", fmt.Errorf("failed to get current working directory: %w", err)
183 }
184
185 relPath, err := filepath.Rel(cwd, absPath)
186 if err != nil {
187 return "", fmt.Errorf("failed to get relative path from %q to %q: %w", cwd, absPath, err)
188 }
189
190 return relPath, nil
191}

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected