relative

Package relative turns paths and file paths relative with string manipulation exclusively.

package relative

import "go.abhg.dev/doc2go/internal/relative"

Package relative turns paths and file paths relative with string manipulation exclusively.

Index

Functions

func Filepath

func Filepath(src, dst string) string

Filepath returns a path to dst, relative to src. Both paths must be relative or both paths must be absolute, and they must both be valid file paths for the current system.

This operation relies on string manipulation exlusively, so it doesn't fail.

func Path

func Path(src, dst string) string

Path returns a path to dst, relative to src. Both paths must be relative or both paths must be absolute, and they must both be /-separated.

This operation relies on string manipulation exlusively, so it doesn't fail.