Skip to content

Generics & more

Latest
Compare
Choose a tag to compare
@guregu guregu released this 11 Feb 19:51
25a9e71
  • Now a Go module under the path github.com/guregu/null/v5
    • ⚠️ Please use this instead of from the former gopkg.in path.
    • Previously this package didn't use modules to support ancient pre-go mod environments, but now module support is required.
  • Added missing types from database/sql: Int32, Int16, Byte
  • Added generic Value[T] embedding sql.Null[T]
    • Note that zero.Value[T] requires that T is comparable. null.Value[T] supports any value.
    • This doesn't support TextMarshaler because there's no generic way to support all types (e.g. structs). We could support some types but I'm not sure if that's useful.
    • This type requires Go version ≥1.22, on lower versions it won't be present

Behavior from v4 is unchanged, so it should be an easy upgrade.
Thank you and enjoy.

What's Changed

Full Changelog: v4.0.0...v5.0.0