Help us shape the future of Go! Take the 2026 Go Developer Survey

pathutil

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package pathutil validates untrusted repository-relative paths in one place.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RepoRelative

func RepoRelative(p string) (string, error)

RepoRelative validates a slash-separated repository-relative path and returns its cleaned form. Absolute paths, backslashes, control separators and parent traversal are rejected.

func ResolveInside

func ResolveInside(root, rel string) (string, error)

ResolveInside resolves a repository-relative path, following symlinks, and refuses results outside root. Use it for reading existing working-tree files.

func StatePath

func StatePath(root, rel string) (string, error)

StatePath returns a location for Radar-owned state below root. It never follows a symlink in any existing component, so state cannot be redirected.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL