dehub/typeobj
mediocregopher 4389da48e4 Fix a bug in typeobj when a type field's name is the same as one of its inner...
---
type: change
description: |-
  Fix a bug in typeobj when a type field's name is the same as one of its inner fields

  This specifically came up with Comment (though it wasn't caught because an error
  wasn't being caught, that's fixed here as well). Prior to unmarshaling into the
  selected inner struct field, typeobj.UnmarshalYAML unmarshals into the outer
  struct in order to unmarshal all non-type fields. However, if one of the fields
  intended for the inner struct field has the same name as one of the type fields
  in the outer struct there would be a conflict at this point.

  The solution is to modify the type of the outer struct being unmarshaled into at
  this stage, so that all fields with type tags automatically have a `yaml:"-"`
  tag, and so are ignored by the yaml unmarshaler at this stage.
fingerprint: AL32FBVJ7Bu2dz1ysrCiRFz2/y+QuaEyhKygvWP/fihw
credentials:
- type: pgp_signature
  pub_key_id: 95C46FA6A41148AC
  body: iQIzBAABAgAdFiEEJ6tQKp6olvZKJ0lwlcRvpqQRSKwFAl6rQYoACgkQlcRvpqQRSKzs0RAAkdU5Ty2uigHZSXqSgU4JiDLMmzlr4B4ODautUuLBmdskVaAAuOUJuS+egUU6Xz6lmL4+zQRBNGCvaZTxu0OT4H4wFWNQ9RdurLbuSJDeQY4htn5bP6BqcOy5aiTiYpnrZu6yuzMTco4jVSZ961o6t829gDBu1jAk32i/l3ivQpMSijEwjK9m74jKxF+fIVqT3+isgs0qzaDkskpdlDEgd/cf4Ibeb1+BAEZRShMXHBhF415rldjYs9H1Q2TSVwAaP7Zqn9gIV04yB/C8Waysh/NCMsIvQcACbVoO9vSBQ/1d+jttI+KTqOTA8lQ/ygWrFdYtPBjXRO7CVrah7PPE+EbFbPBbjH6ddP20uVeoTPTcjUwaWpdg5e4vZfuqXEe0IWW8NyMh8UL1tJ1LpLlWZKx6tz7gcUgoq+jOLUmUG5EB8HjQfqZx6WDHuyPTpy3c646SaIjg8B8tKkwUR+w9zntId7N4mWB+c+qMDH72mU54sXJ/i+XexqZaQgQiz2jRcltNc4S+/ohT5UDAYuivJsCDBcZdOYiMIB2cnPsm2DbCdbQPAq4oK1Ni+2wo7Pj9nVENamc+g6evqCnBZsWQUt5bDUwneIFwYcqdIPulX0NV9rtZQxexIkCmsO1vSrzdkeNyfWizFlRLavW5OBmxuLtoFoZUv5Oijwu8QT0eXMU=
  account: mediocregopher
2020-04-30 15:22:27 -06:00
..
typeobj_test.go Fix a bug in typeobj when a type field's name is the same as one of its inner... 2020-04-30 15:22:27 -06:00
typeobj.go Fix a bug in typeobj when a type field's name is the same as one of its inner... 2020-04-30 15:22:27 -06:00