---
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
message: |-
Add 'default' tag functionality to typeobj
Adding "default" to a typeobj tag now makes that field the default one to use if
there's not a type field set in the input data. This is necessary because all
the old commit objects in this repo don't have a type field set, but they will
need to default to "commit".
change_hash: AP+DSWWe9K0wnnEV1wNt3u/Q89tEOf35zZGWjdES/d2t
credentials:
- type: pgp_signature
pub_key_id: 95C46FA6A41148AC
body: iQIzBAABAgAdFiEEJ6tQKp6olvZKJ0lwlcRvpqQRSKwFAl5gOgkACgkQlcRvpqQRSKxG7hAAsWbbW+Vb7zmD3m32sQYQSY2e8OAClLGAB5tjWURp/bhFJUXf2T2aMPTPW4wNztQM2OgzcsIlAvFWRl8I/rUa9L04U/vvcA7vo03KYLLjTjqz6HEkeTg5is8gF/jJDdt7YBFpXJVaUu9b2hInpo87iyfsRYfxF832huvCrVxftd3eQcF/l33sWakwlc539M7UZ6V/kED2FQ0X8bhiOXCFrBrsb5cpedyNcdnFclOKk++y71pMoVU4r1Jm57i+f7HInxnFl7hm7Z82clgzYTPgr0Da43OB1RR/LOzTzPqHA/e9TUx/TSWd2Zu/MTdNiFRhNoMz0SdxXcXw805HGqoIK1s3pHiiaeujgFtnFWYuvnqQ5H7rOjf3lr+ig3pi9qsBR+/upOfw4iIP590OGC+JOu51PGe9NkOyRFi49j6j8BtFXxIVk49znMgqd242hOxh17u7LCHW/YS2nZVdFqoQZCNlpEJRuM18XvJ1c9bkulFNd4rkXEExEhedFEIm8fFWM04VwVbdimvRO4/YfU6MzPi/T/5hGhd1Gmauk/TwpQyoEsw/VDZU600uz0YVt2XnsoSRPcfcCX1uYjaYhrKadddCwuLpl8hvtWwd8EIaIfq6vcUVeBLxX53xb3mlo48wDOYDz7v3MJO/oKzoSLui/wAT/5fOoFVs6XT9F8AmhlM=
account: mediocregopher