mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-15 01:17:34 +00:00
9642d4c8fd
* Add flag to write job reports to disk * Fix nil pointer / non-nil interface bug * Synchronize job report writer goroutine * Log when the report has been written
16 lines
471 B
Go
16 lines
471 B
Go
package common
|
|
|
|
// ExportError is an implementation of error that can be JSON marshalled. It
|
|
// must be a public exported type for this reason.
|
|
type ExportError string
|
|
|
|
func (e ExportError) Error() string { return string(e) }
|
|
|
|
// ExportErrors converts a list of errors into []ExportError.
|
|
func ExportErrors(errs ...error) []error {
|
|
output := make([]error, 0, len(errs))
|
|
for _, err := range errs {
|
|
output = append(output, ExportError(err.Error()))
|
|
}
|
|
return output
|
|
}
|