Skip to content

Commit

Permalink
Use PtrTo to not require Go 1.18 (#874)
Browse files Browse the repository at this point in the history
  • Loading branch information
pelletier committed May 23, 2023
1 parent 44c1513 commit 7b980e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unmarshaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ func (d *decoder) keyFromData(keyType reflect.Type, data []byte) (reflect.Value,
}
return mk, nil

case reflect.PointerTo(keyType).Implements(textUnmarshalerType):
case reflect.PtrTo(keyType).Implements(textUnmarshalerType):
mk := reflect.New(keyType)
if err := mk.Interface().(encoding.TextUnmarshaler).UnmarshalText(data); err != nil {
return reflect.Value{}, fmt.Errorf("toml: error unmarshalling key type %s from text: %w", stringType, err)
Expand Down

0 comments on commit 7b980e7

Please sign in to comment.