// prefixError wraps an error with a prefix or returns nil if there was no error.
// This is useful for wrapping errors returned by generic error funcs like `validateNonEmpty` so that the error includes the offending field name.
prefixError wraps an error with a prefix or returns nil if there was no error.
This is useful for wrapping errors returned by generic error funcs like `validateNonEmpty` so that the error includes the offending field name.
// prefixError wraps an error with a prefix or returns nil if there was no error . // This is useful for wrapping errors returned by generic error funcs like ` validateNonEmpty ` so that the error includes the offending field name .
func prefixError(prefix string, err error) error {
	if err != nil {
		return fmt.Errorf("%s: %v", prefix, err)
	}
	return nil
}
func prefixError ( prefix string , err error ) error { if err != nil { return fmt . Errorf ( " " , prefix , err ) } return nil }
prefixError wraps an error with a prefix or returns nil if there was no error.
prefixError wraps an error with a prefix or returns nil if there was no error .