options

package
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package options provides cross type transformations for `mo.Option`.

The functions provided by this package are not methods of `mo.Option` due to the lack of method type parameters on methods. This is part of the design decision of the Go's generics as explained here: https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#No-parameterized-methods

Providing these methods as a separate package also matches Go's primitives and standard library: - The `string` type don't have methods, but there we have the `strings` package. - The `[]byte` type don't have methods, but there we have the `bytes` package. - The `io.Reader` defines a single method, and all manipulations of a reader is done on packages `io` and `ioutil`.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL