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

basename

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package basename implements the `basename` built-in.

Forms (POSIX + GNU):

basename NAME [SUFFIX]
basename -a NAME...
basename -s SUFFIX NAME...

Trailing slashes are stripped before extracting the basename (matching coreutils). When SUFFIX is supplied it is removed from the result only if the result is longer than SUFFIX (so `basename .x .x` returns ".x", not "").

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() command.Command

New returns the basename command.

Types

This section is empty.

Jump to

Keyboard shortcuts

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