An IPFS implementation in Go
Go to file
Marten Seemann 2cf170d5fa go-ipfs-config: feat: add an OptionalDuration type (#148)
* feat: make it possible to define optional durations
* test: empty/default optional durations
does not crash if user restores default value and sets it to empty string ""

* refactor: use null in JSON
* refactor(duration): use JSON null as the default

Rationale:
https://github.com/ipfs/go-ipfs-config/pull/148#discussion_r736975879

* refactor: Duration → OptionalDuration

This makes it possible to use OptionalDuration with `json:",omitempty"`
so the null is not serialized to JSON, and get working WithDefault as well.

Co-authored-by: Marcin Rataj <lidel@lidel.org>
2021-10-27 18:23:35 +02:00
config go-ipfs-config: feat: add an OptionalDuration type (#148) 2021-10-27 18:23:35 +02:00