-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[doc] fmt.Printf don't using reflect for everything
- #26 - checked code for `fmt.Printf`, the real logic is in `printArg(arg interface{}, verb rune)`, which would print simple types like `int`, `[]byte` directly, though there are many indirection and goes to `strconv` eventually. for other types (i.e. type MyInt int), reflection is needed, `printValue(value reflect.Value, verb rune, depth int)` - but `Printf` supports formatting like `%0.2f`, I don't remember how zap would handle that, let user call `fmt.Sprintf` for message maybe?
- Loading branch information
Showing
1 changed file
with
269 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters