mirror of
https://github.com/IBM/fp-go.git
synced 2025-08-10 22:31:32 +02:00
fix: linter bugs
Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
@@ -36,8 +36,8 @@ func (inner *Inner) getA() int {
|
||||
return inner.A
|
||||
}
|
||||
|
||||
func (inner *Inner) setA(A int) *Inner {
|
||||
inner.A = A
|
||||
func (inner *Inner) setA(a int) *Inner {
|
||||
inner.A = a
|
||||
return inner
|
||||
}
|
||||
|
||||
|
@@ -33,8 +33,8 @@ type Optional[S, A any] struct {
|
||||
// modifying that copy
|
||||
func setCopy[SET ~func(*S, A) *S, S, A any](setter SET) func(s *S, a A) *S {
|
||||
return func(s *S, a A) *S {
|
||||
copy := *s
|
||||
return setter(©, a)
|
||||
cpy := *s
|
||||
return setter(&cpy, a)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -22,8 +22,8 @@ import (
|
||||
O "github.com/IBM/fp-go/option"
|
||||
)
|
||||
|
||||
// PrismAsOptional converts a prism into an optional
|
||||
func PrismAsOptional[S, A any](sa P.Prism[S, A]) OPT.Optional[S, A] {
|
||||
// AsOptional converts a prism into an optional
|
||||
func AsOptional[S, A any](sa P.Prism[S, A]) OPT.Optional[S, A] {
|
||||
return OPT.MakeOptional(
|
||||
sa.GetOption,
|
||||
func(s S, a A) S {
|
||||
@@ -38,5 +38,5 @@ func PrismSome[A any]() P.Prism[O.Option[A], A] {
|
||||
|
||||
// Some returns a `Optional` from a `Optional` focused on the `Some` of a `Option` type.
|
||||
func Some[S, A any](soa OPT.Optional[S, O.Option[A]]) OPT.Optional[S, A] {
|
||||
return OPT.Compose[S](PrismAsOptional(PrismSome[A]()))(soa)
|
||||
return OPT.Compose[S](AsOptional(PrismSome[A]()))(soa)
|
||||
}
|
||||
|
Reference in New Issue
Block a user