-
-
Notifications
You must be signed in to change notification settings - Fork 217
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Program:
package main
import (
"github.com/pterm/pterm"
)
func main() {
l := pterm.DefaultLogger
l.Info("message", l.Args("Hello", ", World!"))
l.Info("message", l.Args("foo", "bar", "Hello", ", World!"))
l.Info("message", l.Args(", World!"))
l.Info("message", l.Args("foo", "bar", ", World!"))
l.Info("message", l.Args("foo", "bar", "Hello", ", World!", "baz"))
}Output:
❯ go run ~/Downloads/gotest/main.go
2024-02-01 12:17:38 INFO message Hello: , World!
2024-02-01 12:17:38 INFO message foo: bar Hello: , World!
panic: runtime error: index out of range [1] with length 1
goroutine 1 [running]:
github.com/pterm/pterm.Logger.Args({0x0, {0x1010a8608, 0x14000048018}, 0x3, 0x0, 0x0, 0x1, {0x101048ea3, 0x13}, 0x14000072990, ...}, ...)
/Users/tylergillson/go/pkg/mod/github.com/pterm/pterm@v0.12.76/logger.go:216 +0x1c4
main.main()
/Users/tylergillson/Downloads/gotest/main.go:11 +0x25c
exit status 2Perhaps this could be handled more gracefully?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working