We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c578b09 commit e64d6fcCopy full SHA for e64d6fc
cmd/formatter/errors.go
@@ -45,8 +45,12 @@ type ErrorMessage struct {
45
46
// MarshalJSON allows to marshal this object as a JSON object.
47
func (err ErrorMessage) MarshalJSON() ([]byte, error) {
48
- return json.Marshal(map[string]string{
49
- "error": err.message,
+ type JSONErrorMessage struct {
+ Error string `json:"error,required"`
50
+ }
51
+
52
+ return json.Marshal(JSONErrorMessage{
53
+ Error: err.message,
54
})
55
}
56
0 commit comments