glop/

directory
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: BSD-3-Clause

README

glop

Package glop is Go Language Outtake Packages: Stuff that should have been in the Go standard library, and convenient wrappers that make high-frequency steps more convenient (often using generics).

Everything in here is very short and lightweight -- anything requiring more than a few lines of code should be in its own separate repository.

  • dirs has various file-system directory-related functions, including a simple FileExists and various convenience versions for getting a slice of files in a directory.

  • num has a generic version of Abs, a duplicate set of numeric constraints from the std constraints package with the much shorter package name of num and including the overlooked Number, a generic way to set any number to any other number, and conversion between numbers and bools.

  • bools for a Booler and BoolSetter interface, and To/From String methods.

  • indent provides space and tab based indent string generators.

  • runes provides some key elements of strings and bytes operating on a []rune slice, for faster conversion-free performance in cases where you have a slice of runes.

  • atomctr provides convenient method wrappers around sync/atomic for the common case of a shared int64 counter.

  • fatomic provides wrappers around sync/atomic methods for doing atomic operations on floating point numbers.

  • sentence provides functions for creating formatted sentences.

Directories

Path Synopsis
Package atomctr implements basic atomic int64 counter
Package atomctr implements basic atomic int64 counter
Package datasize provides a data size type and constants.
Package datasize provides a data size type and constants.
Package dedupe implements a de-duplication function for any comparable slice type, efficiently using a map to check for duplicates.
Package dedupe implements a de-duplication function for any comparable slice type, efficiently using a map to check for duplicates.
Package dirs provides various utility functions in dealing with directories such as a list of all the files with a given (set of) extensions and finding paths within the Go source directory (GOPATH, etc)
Package dirs provides various utility functions in dealing with directories such as a list of all the files with a given (set of) extensions and finding paths within the Go source directory (GOPATH, etc)
Package elide provides basic text eliding functions.
Package elide provides basic text eliding functions.
Package fatomic provides floating-point atomic operations
Package fatomic provides floating-point atomic operations
Package indent provides trivial indentation generation methods: Tabs, Spaces, and Indent with a selector.
Package indent provides trivial indentation generation methods: Tabs, Spaces, and Indent with a selector.
Package nptime provides a non-pointer version of the time.Time struct that does not have the location pointer information that time.Time has, which is more efficient from a memory management perspective, in cases where you have a lot of time values being kept: https://segment.com/blog/allocation-efficiency-in-high-performance-go-services/
Package nptime provides a non-pointer version of the time.Time struct that does not have the location pointer information that time.Time has, which is more efficient from a memory management perspective, in cases where you have a lot of time values being kept: https://segment.com/blog/allocation-efficiency-in-high-performance-go-services/
Package option provides optional (nullable) types.
Package option provides optional (nullable) types.
Package runes provides a small subset of functions that are found in strings, bytes standard packages, for rune slices.
Package runes provides a small subset of functions that are found in strings, bytes standard packages, for rune slices.
Package tolassert provides functions for asserting the equality of numbers with tolerance (in other words, it checks whether numbers are about equal).
Package tolassert provides functions for asserting the equality of numbers with tolerance (in other words, it checks whether numbers are about equal).

Jump to

Keyboard shortcuts

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