Closed wvell closed 2 years ago
I am using gerrit code review which used this in the json of the rest api: {"-1":"Fails"}. This fails the gofmt as it results in a numeric field name.
{"-1":"Fails"}
This change checks if the sanitized field name is a number. If so it will preprend Num.
To avoid duplicate field names because of sanitizing values the code now keeps a map with used fields for the current struct.
I am using gerrit code review which used this in the json of the rest api:
{"-1":"Fails"}
. This fails the gofmt as it results in a numeric field name.This change checks if the sanitized field name is a number. If so it will preprend Num.
To avoid duplicate field names because of sanitizing values the code now keeps a map with used fields for the current struct.