mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-04 21:32:15 +00:00
chore(deps): update go dependencies (#12094)
This PR updates all (possible) go dependencies and requires a backport to v4.x
This commit is contained in:
@@ -225,7 +225,7 @@ type IdentityProviderLink struct {
|
||||
UpdatedAt time.Time `json:"updatedAt,omitzero" db:"-"`
|
||||
}
|
||||
|
||||
//go:generate enumer -type UserType -transform lower -trimprefix UserType
|
||||
//go:generate enumer -type UserType -transform lower -trimprefix UserType -sql
|
||||
|
||||
type UserType uint8
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"database/sql/driver"
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
@@ -80,3 +81,33 @@ func (i UserType) IsAUserType() bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (i UserType) Value() (driver.Value, error) {
|
||||
return i.String(), nil
|
||||
}
|
||||
|
||||
func (i *UserType) Scan(value interface{}) error {
|
||||
if value == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var str string
|
||||
switch v := value.(type) {
|
||||
case []byte:
|
||||
str = string(v)
|
||||
case string:
|
||||
str = v
|
||||
case fmt.Stringer:
|
||||
str = v.String()
|
||||
default:
|
||||
return fmt.Errorf("invalid value of UserType: %[1]T(%[1]v)", value)
|
||||
}
|
||||
|
||||
val, err := UserTypeString(str)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*i = val
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user