Skip to content

Commit

Permalink
fix spelling mistake (#5256)
Browse files Browse the repository at this point in the history
Co-authored-by: Shenao Zhang <shenao.zhang@shopee.com>
  • Loading branch information
ZhangShenao and Shenao Zhang committed Apr 14, 2022
1 parent d421c67 commit e0ed3ce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions callbacks/helper.go
Expand Up @@ -125,7 +125,7 @@ func checkMissingWhereConditions(db *gorm.DB) {
type visitMap = map[reflect.Value]bool

// Check if circular values, return true if loaded
func loadOrStoreVisitMap(vistMap *visitMap, v reflect.Value) (loaded bool) {
func loadOrStoreVisitMap(visitMap *visitMap, v reflect.Value) (loaded bool) {
if v.Kind() == reflect.Ptr {
v = v.Elem()
}
Expand All @@ -134,17 +134,17 @@ func loadOrStoreVisitMap(vistMap *visitMap, v reflect.Value) (loaded bool) {
case reflect.Slice, reflect.Array:
loaded = true
for i := 0; i < v.Len(); i++ {
if !loadOrStoreVisitMap(vistMap, v.Index(i)) {
if !loadOrStoreVisitMap(visitMap, v.Index(i)) {
loaded = false
}
}
case reflect.Struct, reflect.Interface:
if v.CanAddr() {
p := v.Addr()
if _, ok := (*vistMap)[p]; ok {
if _, ok := (*visitMap)[p]; ok {
return true
}
(*vistMap)[p] = true
(*visitMap)[p] = true
}
}

Expand Down

0 comments on commit e0ed3ce

Please sign in to comment.