diff --git a/gapr.go b/gapr.go index b3fcc04..18b2b11 100644 --- a/gapr.go +++ b/gapr.go @@ -42,7 +42,7 @@ func (g *Gapr) Map(input any) (any, error) { case reflect.Struct, reflect.Interface: return g.mapStruct(t, v) case reflect.Slice, reflect.Array: - return g.mapSliceOrArray(t, v) + return g.mapSliceOrArray(v) default: return nil, ErrNotSupportedType } @@ -103,7 +103,7 @@ func (g *Gapr) mapMap(t reflect.Type, v reflect.Value) (any, error) { return mapped, nil } -func (g *Gapr) mapSliceOrArray(t reflect.Type, v reflect.Value) (any, error) { +func (g *Gapr) mapSliceOrArray(v reflect.Value) (any, error) { var ( length = v.Len() target = reflect.ValueOf(make([]any, length, length)) @@ -142,7 +142,7 @@ func (g *Gapr) fieldMeta(f reflect.StructField) (drop bool, fieldName string, er return false, "", err } - drop = g.rand.Float64() < 1.0-dropProbability + drop = g.rand.Float64() < dropProbability if tagSplit[1] != "" { fieldName = strings.TrimSpace(tagSplit[1]) }