ulid
errors
DISCONTINUED
Our great sponsors
ulid | errors | |
---|---|---|
11 | 30 | |
4,061 | 7,511 | |
1.8% | - | |
4.3 | 0.2 | |
15 days ago | over 2 years ago | |
Go | Go | |
Apache License 2.0 | BSD 2-clause "Simplified" License |
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.
ulid
-
Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
There is no "tests".
There is just a single test. Which only tests the decoding of a single known value. No encoding test.
Go has infrastructure for benchmarking and fuzzing. Use it!
Also, you took code from https://github.com/oklog/ulid/blob/main/ulid.go which has "Copyright 2016 The Oklog Authors" but this is not mentionned in your base32.go.
-
cmackenzie1/go-uuid: library for generating version 4 (random) and version 7 (time-ordered) UUIDs
maybe because of dependencies: https://github.com/oklog/ulid/blob/main/go.mod ??
You can also have look at https://github.com/oklog/ulid for time ordering generated id purpose
- The most helpful Go Packages
-
UUIDs Are Bad for Database Index Performance, enter UUID7!
Universally Unique Lexicographically Sortable Identifier
-
Is it bad to use short (20 chars) random strings as primary keys?
I'm not concerned too much about the performance or the storage size at this stage. I've checked ulids before posting (more specifically https://github.com/oklog/ulid) but the only difference than a random string (especially if you use them with math.rand) is the timestamp prefix which makes them sortable, but I don't need that (users could use the internal SQLite rowid if they needed to sort by a primary key).
- UUIDs Are Popular, but Bad for Performance
-
Golang Base Project - A simple web app with user authentication
why are you using https://github.com/oklog/ulid to generate a cookie secret?
-
What are your favorite packages to use?
oklog/ulid to generate IDs. coreos/go-oidc for validating JWTs I get from auth. google/go-cmp for comparing structs in tests (unless the project is already using Testify). spf13/pflag because life's too short for Go's flag handling. getkin/kin-openapi for validating reqests/responses against my OpenAPI spec (in tests).
errors
-
Show HN: Error return traces for Go, inspired by Zig
Can you explain why we should this over https://github.com/pkg/errors?
- Error handling and serializing
-
What am I supposed to be doing with errors?
Also - there are some error handling utils that allow you to wrap errors before passing: https://github.com/pkg/errors
-
How to wrap the error best?
Prefer using errors.Wrap and errors.Wrapf from https://github.com/pkg/errors . It's frozen because they don't want to add features, waiting for a re-write of error handling in Go2.
- mdobak/go-xerrors: Yet another error handling library.
-
When ia a good time to panic?
And for "real programs" you can use https://github.com/pkg/errors (if you want stack traces)
-
My next client wants to redevelop a java Webapp with go
pkg/errors or stdlib errors - Error handling, but I wrote my own package for that tailored to my projects' needs. (FYI primalskill/errors but please don't use it as it's not production-ready yet and it will change a lot)
-
What are some good open source project to read when learning Go?
https://github.com/pkg/errors - errors with stack traces
-
Anyone using github.com/pkg/errors for stack traces?
The pkg.go.dev page lists 14k+ projects importing it, but the Github repository has been archived which would seem to discourage use. I'm also not a huge fan of the naming conflict with the stdlib errors package. The README notes it went into maintenance mode but it appears this, too, has passed.
-
go-faster/errors: clear go error wrapping with caller (xerrors fork with Wrap)
The pkg/errors and xerrrors are not maintainted
What are some alternatives?
nanoid - A tiny and fast Go unique string generator
xid - xid is a globally unique id generator thought for the web
gouid - Fast, dependable universally unique ids
sno - Compact, sortable and fast unique IDs with embedded metadata.
zerolog - Zero Allocation JSON Logger
autoflags - Populate go command line app flags from config struct
go-multierror - A Go (golang) package for representing a list of errors as a single error.
logrus - Structured, pluggable logging for Go.
bitio - Optimized bit-level Reader and Writer for Go.
Testify - A toolkit with common assertions and mocks that plays nicely with the standard library
errorx - A comprehensive error handling library for Go
uuid - Generate, encode, and decode UUIDs v1 with fast or cryptographic-quality random node identifier.