An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 8.1% dependent packages on proxy.golang.org

proxy.golang.org : github.com/creachadair/flax

Package flax implements a helper for attaching flags to the fields of struct values. Typical use is to define one or more structs carrying groups of related flags, identified by field tags. For example, here is a struct with three flags: The Check function identifies tagged fields that can then be bound to a standard flag.FlagSet for flag parsing. For example: The Check function reports an error if its argument does not contain any valid flag targets. The Check documentation details the field tag format and flag rules. For the common case of binding flags at program initialization, the MustBind and MustBindAll functions combine these two steps, with a panic in case of error. This package can bind a field of any of the default types supported by the standard flag package, including any type that implements the flag.Value interface. In addition, a field whose type implements the encoding.TextMarshaler and encoding.TextUnmarshaler interfaces can be bound as a flag, using the UnmarshalText method to "set" the flag and using its MarshalText method to render the value of the field. If a field implements both flag.Value and the text marshaling interfaces, the flag value implementation is used.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/creachadair/flax
License: BSD-3-Clause
Latest release: 6 months ago
First release: over 2 years ago
Namespace: github.com/creachadair
Dependent packages: 5
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: about 1 month ago

    Loading...
    Readme
    Loading...