File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 55require (
66 github.com/go-playground/errors/v5 v5.2.2
77 github.com/go-playground/pkg/v5 v5.6.0
8+ golang.org/x/term v0.0.0-20220526004731-065cf7ba2467
89)
10+
11+ require golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect
Original file line number Diff line number Diff line change @@ -2,3 +2,7 @@ github.com/go-playground/errors/v5 v5.2.2 h1:1C8GMFeObklONQn7v7Y09kTrNgibvbS3+eJ
22github.com/go-playground/errors/v5 v5.2.2 /go.mod h1:DincxRGwraWmq39TZDqtnOtHGOJ+AbNbO0OmBzX6MLw =
33github.com/go-playground/pkg/v5 v5.6.0 h1:97YpRFzIcS5NFP2Uzxj8cPYz4zTuwweyXADYcA1KfUQ =
44github.com/go-playground/pkg/v5 v5.6.0 /go.mod h1:TvZ2nNtNh6VfoNteY9ApA2BXt1ZwJliFZ4hzPAwLS9Y =
5+ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4 =
6+ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 /go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg =
7+ golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 h1:CBpWXWQpIRjzmkkA+M7q9Fqnwd2mZr3AFqexg8YTfoM =
8+ golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 /go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8 =
Original file line number Diff line number Diff line change 55 "os"
66 "sync"
77 "time"
8+
9+ "golang.org/x/term"
810)
911
1012var (
1921)
2022
2123func init () {
22- h := NewBuilder ().Build ()
23- AddHandler (h , AllLevels ... )
24- defaultHandler = h
24+ if term .IsTerminal (int (os .Stdin .Fd ())) {
25+ h := NewBuilder ().Build ()
26+ AddHandler (h , AllLevels ... )
27+ defaultHandler = h
28+ }
2529}
2630
2731const (
You can’t perform that action at this time.
0 commit comments