Fix golint
This commit is contained in:
parent
433f2c9b36
commit
2218107f1f
|
@ -15,7 +15,7 @@ func OptionParser(x ConsoleParser) Option {
|
||||||
// OptionWriter to set a custom ConsoleWriter object. An argument should implement ConsoleWriter interface.
|
// OptionWriter to set a custom ConsoleWriter object. An argument should implement ConsoleWriter interface.
|
||||||
func OptionWriter(x ConsoleWriter) Option {
|
func OptionWriter(x ConsoleWriter) Option {
|
||||||
return func(p *Prompt) error {
|
return func(p *Prompt) error {
|
||||||
RegisterConsoleWriter(x)
|
registerConsoleWriter(x)
|
||||||
p.renderer.out = x
|
p.renderer.out = x
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -229,7 +229,7 @@ func OptionAddASCIICodeBind(b ...ASCIICodeBind) Option {
|
||||||
// New returns a Prompt with powerful auto-completion.
|
// New returns a Prompt with powerful auto-completion.
|
||||||
func New(executor Executor, completer Completer, opts ...Option) *Prompt {
|
func New(executor Executor, completer Completer, opts ...Option) *Prompt {
|
||||||
defaultWriter := NewStandardOutputWriter()
|
defaultWriter := NewStandardOutputWriter()
|
||||||
RegisterConsoleWriter(defaultWriter)
|
registerConsoleWriter(defaultWriter)
|
||||||
|
|
||||||
pt := &Prompt{
|
pt := &Prompt{
|
||||||
in: NewStandardInputParser(),
|
in: NewStandardInputParser(),
|
||||||
|
|
|
@ -7,7 +7,7 @@ var (
|
||||||
consoleWriter ConsoleWriter
|
consoleWriter ConsoleWriter
|
||||||
)
|
)
|
||||||
|
|
||||||
func RegisterConsoleWriter(f ConsoleWriter) {
|
func registerConsoleWriter(f ConsoleWriter) {
|
||||||
consoleWriterMu.Lock()
|
consoleWriterMu.Lock()
|
||||||
defer consoleWriterMu.Unlock()
|
defer consoleWriterMu.Unlock()
|
||||||
consoleWriter = f
|
consoleWriter = f
|
||||||
|
|
Loading…
Reference in New Issue