Replace %v with %w for error

https://golang.org/pkg/fmt/#Errorf
This commit is contained in:
CreativeCactus
2020-10-01 17:36:44 +10:00
committed by GitHub
parent d131c24e23
commit c81a54c5aa
+1 -1
View File
@@ -402,7 +402,7 @@ func (f *MyJSONFormatter) Format(entry *Entry) ([]byte, error) {
// source of the official loggers.
serialized, err := json.Marshal(entry.Data)
if err != nil {
return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err)
return nil, fmt.Errorf("Failed to marshal fields to JSON, %w", err)
}
return append(serialized, '\n'), nil
}