Readlink returns the destination of a symlink.
(path string)
| 405 | |
| 406 | // Readlink returns the destination of a symlink. |
| 407 | func (p *packageFS) Readlink(path string) (string, error) { |
| 408 | osPath, err := p.OSPath(path) |
| 409 | if err != nil { |
| 410 | return "", err |
| 411 | } |
| 412 | // TODO(gcurtis): check that the symlink isn't absolute or points |
| 413 | // outside the Nix store. |
| 414 | return os.Readlink(osPath) |
| 415 | } |
| 416 | |
| 417 | // OSPath translates a package-relative path to an operating system path. |
| 418 | func (p *packageFS) OSPath(path string) (string, error) { |
no test coverage detected