Skip to content

Commit

Permalink
doc: add utils 'er' and 'wrStringAndCheck'
Browse files Browse the repository at this point in the history
  • Loading branch information
umarcor committed Jun 7, 2019
1 parent 87247a0 commit 097a55c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions doc/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package doc

import (
"io"
"strings"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -49,3 +50,11 @@ type byName []*cobra.Command
func (s byName) Len() int { return len(s) }
func (s byName) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
func (s byName) Less(i, j int) bool { return s[i].Name() < s[j].Name() }

func er(msg interface{}) {
cobra.Er(msg)
}

func wrStringAndCheck(b io.StringWriter, s string) {
cobra.WrStringAndCheck(b, s)
}

0 comments on commit 097a55c

Please sign in to comment.