vendor
This commit is contained in:
parent
07ec5529ac
commit
f501abe660
532 changed files with 271781 additions and 0 deletions
22
vendor/github.com/samber/mo/option_go122.go
generated
vendored
Normal file
22
vendor/github.com/samber/mo/option_go122.go
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
//go:build go1.22
|
||||
// +build go1.22
|
||||
|
||||
package mo
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func (o *Option[T]) scanConvertValue(src any) error {
|
||||
// we try to convertAssign values that we can't directly assign because ConvertValue
|
||||
// will return immediately for v that is already a Value, even if it is a different
|
||||
// Value type than the one we expect here.
|
||||
var st sql.Null[T]
|
||||
if err := st.Scan(src); err == nil {
|
||||
o.isPresent = true
|
||||
o.value = st.V
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("failed to scan Option[T]")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue