Skip to content

Commit 6b6b5bd

Browse files
authored
Fix logger example (#871)
Since `msg` is formatted we should call `Printf` because `Println` doesn't support variadic arguments
1 parent a9325a2 commit 6b6b5bd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,8 @@ For visiblity into the operations of the Reader/Writer types, configure a logger
697697

698698
```go
699699
func logf(msg string, a ...interface{}) {
700-
fmt.Println(msg, a...)
700+
fmt.Printf(msg, a...)
701+
fmt.Println()
701702
}
702703

703704
r := kafka.NewReader(kafka.ReaderConfig{
@@ -713,7 +714,8 @@ r := kafka.NewReader(kafka.ReaderConfig{
713714

714715
```go
715716
func logf(msg string, a ...interface{}) {
716-
fmt.Println(msg, a...)
717+
fmt.Printf(msg, a...)
718+
fmt.Println()
717719
}
718720

719721
w := &kafka.Writer{

0 commit comments

Comments
 (0)