20 lines
421 B
Go
20 lines
421 B
Go
package hopp
|
|
|
|
import "git.tebibyte.media/sashakoshka/go-util/container"
|
|
|
|
// Option allows an optional value to be defined without using a pointer.
|
|
// TODO make generic alias once go 1.24 releases
|
|
type Option[T any] ucontainer.Optional[T]
|
|
|
|
func (option *Option[T]) Get() (T, bool) {
|
|
return option.Get()
|
|
}
|
|
|
|
func (option *Option[T]) Set(value T) {
|
|
option.Set(value)
|
|
}
|
|
|
|
func (option *Option[T]) Reset() {
|
|
option.Reset()
|
|
}
|