From 4f8ee6f9191cbb8997f83e5beedf837e64c2dbcb Mon Sep 17 00:00:00 2001 From: Diego Sogari Date: Sat, 1 Apr 2023 13:50:32 -0300 Subject: [PATCH] Fix go vet errors --- schemas/association.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/schemas/association.go b/schemas/association.go index 56cbca6d..147dcfe0 100644 --- a/schemas/association.go +++ b/schemas/association.go @@ -30,12 +30,12 @@ func (a *Association) MakeJoinMap() reflect.Value { // MakeRefMap creates a map to hold the result of an association query func (a *Association) MakeRefMap() reflect.Value { - return reflect.MakeMap(reflect.MapOf(a.RefPkType, reflect.PointerTo(a.RefTable.Type))) + return reflect.MakeMap(reflect.MapOf(a.RefPkType, reflect.PtrTo(a.RefTable.Type))) } // ValidateOwnMap validates the type of the owner map (parent of an association) func (a *Association) ValidateOwnMap(ownMap reflect.Value) error { - if ownMap.Type() != reflect.MapOf(a.OwnPkType, reflect.PointerTo(a.OwnTable.Type)) { + if ownMap.Type() != reflect.MapOf(a.OwnPkType, reflect.PtrTo(a.OwnTable.Type)) { return fmt.Errorf("wrong map type: %v", ownMap.Type()) } return nil @@ -60,7 +60,7 @@ func (a *Association) condBelongsTo(ownMap reflect.Value) builder.Cond { for iter.Next() { structPtr := iter.Value() fk, _ := fkCol.ValueOfV(&structPtr) - if fk.Type().Kind() == reflect.Pointer { + if fk.Type().Kind() == reflect.Ptr { if fk.IsNil() { continue } @@ -114,7 +114,7 @@ func (a *Association) linkBelongsTo(ownMap, refMap, pruneMap reflect.Value) { for iter.Next() { structPtr := iter.Value() fk, _ := fkCol.ValueOfV(&structPtr) - if fk.Type().Kind() == reflect.Pointer { + if fk.Type().Kind() == reflect.Ptr { if fk.IsNil() { continue } @@ -140,7 +140,7 @@ func (a *Association) linkHasOneOrMany(ownMap, refMap, pruneMap reflect.Value) { for iter.Next() { refStructPtr := iter.Value() fk, _ := fkCol.ValueOfV(&refStructPtr) - if fk.Type().Kind() == reflect.Pointer { + if fk.Type().Kind() == reflect.Ptr { if fk.IsNil() { continue }