mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
Update go dependencies (#3480)
* Bump golang.org/x/text from 0.3.7 to 0.3.8 Bumps [golang.org/x/text](https://github.com/golang/text) from 0.3.7 to 0.3.8. - [Release notes](https://github.com/golang/text/releases) - [Commits](https://github.com/golang/text/compare/v0.3.7...v0.3.8) --- updated-dependencies: - dependency-name: golang.org/x/text dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * Update go dependencies * Update x/net --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
21
vendor/github.com/99designs/gqlgen/internal/code/compare.go
generated
vendored
21
vendor/github.com/99designs/gqlgen/internal/code/compare.go
generated
vendored
@@ -39,12 +39,16 @@ func CompatibleTypes(expected types.Type, actual types.Type) error {
|
||||
}
|
||||
|
||||
case *types.Basic:
|
||||
if actual, ok := actual.(*types.Basic); ok {
|
||||
if actual.Kind() != expected.Kind() {
|
||||
return fmt.Errorf("basic kind differs, %s != %s", expected.Name(), actual.Name())
|
||||
if actualBasic, ok := actual.(*types.Basic); ok {
|
||||
if similarBasicKind(actualBasic.Kind()) != expected.Kind() {
|
||||
return fmt.Errorf("basic kind differs, %s != %s", expected.Name(), actualBasic.Name())
|
||||
}
|
||||
|
||||
return nil
|
||||
} else if actual, ok := actual.(*types.Named); ok {
|
||||
if underlyingBasic, ok := actual.Underlying().(*types.Basic); ok {
|
||||
return CompatibleTypes(expected, underlyingBasic)
|
||||
}
|
||||
}
|
||||
|
||||
case *types.Struct:
|
||||
@@ -159,3 +163,14 @@ func CompatibleTypes(expected types.Type, actual types.Type) error {
|
||||
|
||||
return fmt.Errorf("type mismatch %T != %T", expected, actual)
|
||||
}
|
||||
|
||||
func similarBasicKind(kind types.BasicKind) types.BasicKind {
|
||||
switch kind {
|
||||
case types.Int8, types.Int16:
|
||||
return types.Int64
|
||||
case types.Uint, types.Uint8, types.Uint16, types.Uint32: // exclude Uint64: it still needs scalar with custom marshalling/unmarshalling because it is bigger then int64
|
||||
return types.Int64
|
||||
default:
|
||||
return kind
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user