internal

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterDown

func FilterDown[E any, R any](S []E, F func(E) *R) []R

func NewLogWriter

func NewLogWriter(logger *log.Logger, level log.Level) io.Writer

func SliceDice

func SliceDice[E any, R any](S []E, F func(E) R) []R

func Slugify

func Slugify(s string) string

func SplitArgs

func SplitArgs(s string) ([]string, error)

SplitArgs splits a shell-like string into a slice of tokens. It handles single-quoted, double-quoted, and backslash-escaped tokens, so e.g. `-ldflags "-X main.Version=1.0"` yields ["-ldflags", "-X main.Version=1.0"]. Returns an error if the string contains an unclosed quote or a trailing backslash.

Types

type LogWriter

type LogWriter struct {
	Logger *log.Logger
	Level  log.Level
	// contains filtered or unexported fields
}

func (*LogWriter) Close

func (w *LogWriter) Close() error

Close flushes any buffered partial line to the logger.

func (*LogWriter) Write

func (w *LogWriter) Write(p []byte) (n int, err error)

Write buffers p and emits any complete lines to the logger. Partial lines (no trailing newline) are held until the next write or Close.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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