gommon
gommon copied to clipboard
[error] Support fmt.Formatter interface
I am used to log.Warnf("err %v", err), but since we didn't implement formatter interface, the result is just struct ... it's quite a pain to call err.Error everytime
- https://golang.org/pkg/fmt/#Formatter
type Formatter interface {
Format(f State, c rune)
}
- [ ] does
%wneed some extra handling? - [x] print string #63
- [ ] print stack
- [ ] pass format to inner error and multi error
- [ ] it seems non standard formatter is also possible?
强无敌
the print interface seems also changed with new x/errors #109
Although it is important ... won't hurt without its full implementation ... so moved it to 0.0.14