pathmod

package
v0.0.0-...-d44b1b6 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pathmod implements the path module: path.exists(), path.join(), path.glob() and path.list(). They only read, so they're plain queries that return their answer directly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(ctx context.Context, fsys afero.Fs) *base.Query

Exists returns path.exists(). It reports whether path, an absolute path (~ expands), names a file or directory, following symlinks. It returns False only when the path doesn't exist; any other error, such as permission denied, stops the run, so a path starcm can't check never looks missing.

func Join

func Join() *starlark.Builtin

Join returns the path.join() builtin. It joins its string parts with the platform's separator and cleans the result, as Go's filepath.Join does. Empty parts are ignored. It doesn't touch the filesystem or expand ~.

func New

func New(ctx context.Context, fsys afero.Fs) *starlarkstruct.Module

New returns the path module, which reads the filesystem through fsys.

path.join(home_dir(), "go", "bin")         # "/Users/me/go/bin"
path.exists("/usr/local/bin/go")           # True or False
path.glob(here("third_party/*/go.mod"))    # ["/.../a/go.mod", ...]
path.list(here("config"), pattern = "*.star")

Types

This section is empty.

Jump to

Keyboard shortcuts

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