Skip to content

v0.4.0

Compare
Choose a tag to compare
@qdm12 qdm12 released this 25 Mar 19:12
· 6 commits to main since this release

Breaking changes

  • reader and internal/parse packages which replace previous sources/env and sources/merge packages
    • Reader reads from multiple sources in order for each call
    • By default, the reader uses the flags source then the environment variable source
    • internal/parse contains only pure functions to make full use of Go 1.18+ generics
    • Update all code comments, merge example and readme document
  • Merge functions in merge.go removed (now unneeded due to reader package handling the merging)
  • Override: OverrideWithComparable function, replacing OverrideWithNumber, OverrideWithString, OverrideWithPointerRaw, OverrideWithInterface and OverrideWithSliceRaw
  • Defaults: DefaultComparable function, replacing DefaultNumber, DefaultString, DefaultPointerRaw, DefaultInterface and DefaultSliceRaw
  • Number constraint and constraints.go file removed (no longer needed)

Features

  • reader/sources/env environment variable reader-compatible source
  • reader/sources/flags CLI flags reader-compatible source
  • reader package (previously sources/env):
    • add DefaultOptions setting to apply to each read
    • add FirstKeySet method
    • add CSVNetipAddresses method
    • add NetipPrefix method
    • add NetipAddrPort method
    • add CSVNetipAddrPorts method
    • add builtin types methods: Int8, Int16, Int32, Int64, Int8Ptr, Int16Ptr, Int32Ptr, Int64Ptr, Float32, Float32Ptr and Float64Ptr

Fixes

  • validate: allow empty listening addresses
  • validate: listening port validation
    • Check non root users against unprivileged start port found from Kernel file on Linux
    • Check if the running program has the net_bind_service capability if trying to listen on a privileged port without root or windows
  • internal/parse (previously within sources/env/parse.go):
    • try parsing the empty string if AllowEmpty(true) option is specified
  • reader and internal/parse (previously sources/env):
    • BoolPtr returns nil when the empty string is found

Documentation

  • Update readme and examples with the new usage to merge settings from different sources
  • Review code comments
    • fix godoc comments bullet list formatting
    • fix godoc comments new lines formatting
    • mention default settings for CSV methods
    • mention nil slices conditions for CSV methods
    • change function comment the error context to its message
    • fix CSVNetipPrefixes method comment
    • review AcceptEmpty option comment

Maintenance

  • Upgrade Go from 1.20 to 1.21
  • Upgrade dependency golang.org/x/exp
  • Upgrade CI Docker image Alpine from 3.16 to 3.18
  • Upgrade actions/checkout from 3 to 4 (#12)
  • Bump github/codeql-action from 2 to 3 by @dependabot in #16