chore(lint): fix some condition. (#624)
This commit is contained in:
		
							parent
							
								
									0a8d801380
								
							
						
					
					
						commit
						ea71e99f2d
					
				
							
								
								
									
										18
									
								
								README.md
								
								
								
								
							
							
						
						
									
										18
									
								
								README.md
								
								
								
								
							| 
						 | 
				
			
			@ -1070,10 +1070,13 @@ func main() {
 | 
			
		|||
		},
 | 
			
		||||
	})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		log.Fatalf("could not greet: %v", err)
 | 
			
		||||
		log.Println("could not greet: ", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if r != nil {
 | 
			
		||||
		log.Printf("Success: %t\n", r.Success)
 | 
			
		||||
		log.Printf("Count: %d\n", r.Counts)
 | 
			
		||||
	}
 | 
			
		||||
	log.Printf("Success: %t\n", r.Success)
 | 
			
		||||
	log.Printf("Count: %d\n", r.Counts)
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1172,10 +1175,13 @@ func main() {
 | 
			
		|||
		},
 | 
			
		||||
	})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		log.Fatalf("could not greet: %v", err)
 | 
			
		||||
		log.Println("could not greet: ", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if r != nil {
 | 
			
		||||
		log.Printf("Success: %t\n", r.Success)
 | 
			
		||||
		log.Printf("Count: %d\n", r.Counts)
 | 
			
		||||
	}
 | 
			
		||||
	log.Printf("Success: %t\n", r.Success)
 | 
			
		||||
	log.Printf("Count: %d\n", r.Counts)
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -457,5 +457,5 @@ Retry:
 | 
			
		|||
		goto Retry
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return
 | 
			
		||||
	return resp, nil
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -58,7 +58,7 @@ func TestIOSNotificationStructure(t *testing.T) {
 | 
			
		|||
	test := "test"
 | 
			
		||||
	expectBadge := 0
 | 
			
		||||
	message := "Welcome notification Server"
 | 
			
		||||
	expiration := int64(time.Now().Unix())
 | 
			
		||||
	expiration := time.Now().Unix()
 | 
			
		||||
	req := &PushNotification{
 | 
			
		||||
		ApnsID:     test,
 | 
			
		||||
		Topic:      test,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -228,7 +228,7 @@ Retry:
 | 
			
		|||
		goto Retry
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return
 | 
			
		||||
	return resp, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func logPush(cfg *config.ConfYaml, status, token string, req *PushNotification, err error) logx.LogPushEntry {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -227,5 +227,5 @@ Retry:
 | 
			
		|||
		goto Retry
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return
 | 
			
		||||
	return resp, nil
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -50,8 +50,11 @@ func main() {
 | 
			
		|||
		},
 | 
			
		||||
	})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		log.Fatalf("could not greet: %v", err)
 | 
			
		||||
		log.Println("could not greet: ", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if r != nil {
 | 
			
		||||
		log.Printf("Success: %t\n", r.Success)
 | 
			
		||||
		log.Printf("Count: %d\n", r.Counts)
 | 
			
		||||
	}
 | 
			
		||||
	log.Printf("Success: %t\n", r.Success)
 | 
			
		||||
	log.Printf("Count: %d\n", r.Counts)
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue