(absPath string)
| 177 | } |
| 178 | |
| 179 | func 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 | } |
no outgoing calls
no test coverage detected