aboutsummaryrefslogtreecommitdiff
path: root/option
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2025-07-13 00:41:51 +0200
committerStefan Majewsky <majewsky@gmx.net>2025-07-13 00:41:51 +0200
commit4dece322c205eebd8eb9e391817e2b7af223fc08 (patch)
tree391befbf75a8cd1cbeb79eb7eedaf730194ffaa8 /option
parent9fede8ef986e4bcf8a0b461075fcc13c0fc33c11 (diff)
downloadgo-gg-refinement-types-4.tar.gz
refined: add type Scalarrefinement-types-4
Diffstat (limited to 'option')
-rw-r--r--option/option.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/option/option.go b/option/option.go
index a96e87d..776b16a 100644
--- a/option/option.go
+++ b/option/option.go
@@ -22,11 +22,11 @@
//
// # Marshalling considerations
//
-// Marshaling into and from YAML using https://github.com/go-yaml/yaml is supported.
+// Marshaling into and from YAML using https://github.com/go-yaml/yaml (or one of its many forks) is supported.
// The "omitempty" flag works as expected.
//
// Marshaling into and from JSON using encoding/json is supported, but the "omitempty" flag does not work.
-// You must use the "omitzero" flag to get the same effect, but note that this flag is only supported by Go 1.24 and newer.
+// You must use the "omitzero" flag to get the same effect.
//
// # How to replace pointer types with Option types
//
@@ -367,7 +367,7 @@ func (o *Option[T]) UnmarshalJSON(buf []byte) error {
return nil
}
-// MarshalYAML implements the yaml.Marshaler interface from gopkg.in/yaml.v2 and v3.
+// MarshalYAML implements the yaml.Marshaler interface from gopkg.in/yaml.v2 and v3 as well as their forks.
func (o Option[T]) MarshalYAML() (any, error) {
if o.isSome {
// If we just return o.value directly here, MarshalYAML will not be called
@@ -385,7 +385,7 @@ func (o Option[T]) MarshalYAML() (any, error) {
// UnmarshalYAML implements the yaml.Unmarshaler interface from gopkg.in/yaml.v2.
//
-// gopkg.in/yaml.v3 supports this interface via backwards-compatibility,
+// gopkg.in/yaml.v3 and its forks support this interface via backwards-compatibility,
// so we intentionally do not use the v3-only signature that refers to the yaml.Node type.
func (o *Option[T]) UnmarshalYAML(unmarshal func(any) error) error {
var data *T