reflectx.TypeFor => reflect.TypeFor

Since go1.22 it is now in the standard library and is removed from a
future versio from pkglib
This commit is contained in:
Tom Wiesing 2024-04-08 23:30:15 +02:00
parent ee2f6e08c6
commit 84799afda2
No known key found for this signature in database
9 changed files with 19 additions and 19 deletions

View file

@ -2,12 +2,12 @@ package policy
import (
"context"
"reflect"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/auth"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/sql"
"github.com/FAU-CDI/wisski-distillery/internal/models"
"github.com/tkw1536/pkglib/reflectx"
"gorm.io/gorm"
)
@ -29,7 +29,7 @@ var (
func (pol *Policy) TableInfo() component.TableInfo {
return component.TableInfo{
Name: models.GrantTable,
Model: reflectx.TypeFor[models.Grant](),
Model: reflect.TypeFor[models.Grant](),
}
}

View file

@ -3,13 +3,13 @@ package tokens
import (
"context"
"crypto/rand"
"reflect"
"strings"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/sql"
"github.com/FAU-CDI/wisski-distillery/internal/models"
"github.com/tkw1536/pkglib/password"
"github.com/tkw1536/pkglib/reflectx"
"gorm.io/gorm"
)
@ -30,7 +30,7 @@ var (
func (tok *Tokens) TableInfo() component.TableInfo {
return component.TableInfo{
Name: models.TokensTable,
Model: reflectx.TypeFor[models.Token](),
Model: reflect.TypeFor[models.Token](),
}
}

View file

@ -6,6 +6,7 @@ import (
"encoding/base64"
"fmt"
"image/png"
"reflect"
"strings"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
@ -15,7 +16,6 @@ import (
"github.com/pquerna/otp"
"github.com/pquerna/otp/totp"
"github.com/tkw1536/pkglib/password"
"github.com/tkw1536/pkglib/reflectx"
"golang.org/x/crypto/bcrypt"
)
@ -25,7 +25,7 @@ var ErrUserNotFound = errors.New("user not found")
func (auth *Auth) TableInfo() component.TableInfo {
return component.TableInfo{
Name: models.UserTable,
Model: reflectx.TypeFor[models.User](),
Model: reflect.TypeFor[models.User](),
}
}