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

scope

package
v0.247.0 Latest Latest
Warning

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

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

Documentation

Overview

Package scope resolves cwd to its git toplevel for an audit record's RepoRoot. Best-effort and forensic-only: outside a repo it yields "".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CWD

func CWD() string

CWD returns the current working directory or empty on error. Lets callers write scope.RepoRoot(scope.CWD()) without juggling the os.Getwd error.

func RepoRoot

func RepoRoot(cwd string) string

RepoRoot returns the git toplevel of cwd, "" outside a repo. It walks the filesystem: a `git` replacement on PATH intercepts `rev-parse`. teable umbra#7343.

Types

This section is empty.

Jump to

Keyboard shortcuts

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