warg
scan
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
warg
-
An Efficient Struct Configuration Pattern For Golang
Funcopts aren't always appropriate, but boy do they make things more readable sometimes. I use them pervasively in warg to allow declarative nested CLI commands
-
Which packages do you recommend for building cli tools?
I wrote my own! https://github.com/bbkane/warg/
-
Major standard library changes in Go 1.20
Very useful! I'll be playing with the error tree additions and studying the HTTP interface extension to see if I can replicate the pattern for https://github.com/bbkane/warg values. Id like to be able to have value-specific output for different types of --help , even ones not in warg
-
Have you used generics?
I'm using to allow for custom flag types in my CLI parsing library- a lot less duplicate code
-
Go: Functional Options Are Slow
One thing that I find nicer with functional options is building tree-like data structures.
My command line parsing library uses them to declaratively build CLI apps with arbitrarily nested subcommands.
Some examples at https://github.com/bbkane/warg/tree/master/examples
-
How are YOU using generics so far?
I'm writing a CLI parsing library, and generics have let me consolidate most of the flag value functionality for different types. So the flags for dbz --level 9000 --type superSaiyan share most of the same code even though one is an int and one is a string. So much fewer copy-paste-modify lines of code now!
-
Unix command line conventions over time
This is largely what the Azure CLI does. It simplifies even further by eliminating the no-value option. Instead, you pass "true" or "false" as the value ( --example true ). It's a little more verbose but very easy to parse/write/generate. I like this convention so much I stole it for my homemade Golang CLI parsing library https://github.com/bbkane/warg/ .
scan
-
Bob v0.15.0: Go SQL Access Toolkit (New Documentation Website)
SQL Executor for convenient scanning of results. It is built on the scan package.
- Scan: Scan SQL rows directly to any defined structure. Now with PGX support.
-
Decent examples querying models from Postgres
Personally, I created a scanning package specifically for this based on generics and even more flexibility, still needs a bit more documentation, but check it out Scan.
- Have you used generics?
-
Extracted from the standard library: FakeDB
For example, I've been working on a db scanning package, and it is important to test scanning from a database.
What are some alternatives?
graph - A library for creating generic graph data structures and modifying, analyzing, and visualizing them.
cli-guidelines - A guide to help you write better command-line programs, taking traditional UNIX principles and updating them for the modern day.
be - The Go test helper for minimalists
workgroup - Structured concurrency manager for Go
bob - SQL query builder and ORM/Factory generator for Go with support for PostgreSQL, MySQL and SQLite
golang-generics-dao-example - Example using Generics with DAO
fakedb - fakedb registers a fake database driver named test for... testing.
RCIG_Coordination_Repo - A Coordination repo for all things Rust Cryptography oriented
genericset - simple map-based implementation of generic set in go
infra - Infra provides authentication and access management to servers and Kubernetes clusters.