chore(lint): fix some condition. (#624)
This commit is contained in:
@@ -30,14 +30,7 @@ import (
|
||||
"golang.org/x/crypto/acme/autocert"
|
||||
)
|
||||
|
||||
var (
|
||||
isTerm bool
|
||||
doOnce sync.Once
|
||||
)
|
||||
|
||||
func init() {
|
||||
isTerm = isatty.IsTerminal(os.Stdout.Fd())
|
||||
}
|
||||
var doOnce sync.Once
|
||||
|
||||
func abortWithError(c *gin.Context, code int, message string) {
|
||||
c.AbortWithStatusJSON(code, gin.H{
|
||||
@@ -179,6 +172,7 @@ func routerEngine(cfg *config.ConfYaml, q *queue.Queue) *gin.Engine {
|
||||
|
||||
log.Logger = zerolog.New(os.Stdout).With().Timestamp().Logger()
|
||||
|
||||
isTerm := isatty.IsTerminal(os.Stdout.Fd())
|
||||
if isTerm {
|
||||
log.Logger = log.Output(
|
||||
zerolog.ConsoleWriter{
|
||||
|
||||
@@ -54,12 +54,13 @@ func TestMain(m *testing.M) {
|
||||
queue.WithWorkerCount(4),
|
||||
)
|
||||
q.Start()
|
||||
|
||||
code := m.Run()
|
||||
defer func() {
|
||||
q.Shutdown()
|
||||
q.Wait()
|
||||
os.Exit(code)
|
||||
}()
|
||||
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
|
||||
func initTest() *config.ConfYaml {
|
||||
|
||||
Reference in New Issue
Block a user