From ff0f66940b829dc66c81dad34746d4349b83eb9e Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Wed, 17 Jan 2018 21:06:19 -0800 Subject: [PATCH] refactor cli.New() --- handlers/cli/cli.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/handlers/cli/cli.go b/handlers/cli/cli.go index f49fece..233c58b 100644 --- a/handlers/cli/cli.go +++ b/handlers/cli/cli.go @@ -48,13 +48,13 @@ type Handler struct { // New handler. func New(w io.Writer) *Handler { - switch w2 := w.(type) { - case *os.File: + if f, ok := w.(*os.File); ok { return &Handler{ - Writer: colorable.NewColorable(w2), + Writer: colorable.NewColorable(f), Padding: 3, } } + return &Handler{ Writer: w, Padding: 3,