refactor(log,cmd/install/fish): Small refactors to pass gometalinter.v2
This commit is contained in:
parent
2ef7ee5307
commit
8200804f12
|
@ -46,5 +46,5 @@ end
|
||||||
complete -c {{.Cmd}} -a "(__complete_{{.Cmd}})"
|
complete -c {{.Cmd}} -a "(__complete_{{.Cmd}})"
|
||||||
`)).Execute(&buf, params)
|
`)).Execute(&buf, params)
|
||||||
|
|
||||||
return string(buf.Bytes())
|
return buf.String()
|
||||||
}
|
}
|
||||||
|
|
3
log.go
3
log.go
|
@ -1,7 +1,6 @@
|
||||||
package complete
|
package complete
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
@ -15,7 +14,7 @@ import (
|
||||||
var Log = getLogger()
|
var Log = getLogger()
|
||||||
|
|
||||||
func getLogger() func(format string, args ...interface{}) {
|
func getLogger() func(format string, args ...interface{}) {
|
||||||
var logfile io.Writer = ioutil.Discard
|
var logfile = ioutil.Discard
|
||||||
if os.Getenv(envDebug) != "" {
|
if os.Getenv(envDebug) != "" {
|
||||||
logfile = os.Stderr
|
logfile = os.Stderr
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue