style(be):使用goimport 格式化代码并添加golangci

This commit is contained in:
1mtrue
2021-03-16 14:00:03 +08:00
committed by dushixiang
parent 88b0200095
commit 5e7be397a5
40 changed files with 244 additions and 124 deletions

View File

@ -1,14 +1,16 @@
package handle
import (
"github.com/sirupsen/logrus"
"os"
"strconv"
"time"
"next-terminal/pkg/constant"
"next-terminal/pkg/guacd"
"next-terminal/pkg/model"
"next-terminal/pkg/utils"
"os"
"strconv"
"time"
"github.com/sirupsen/logrus"
)
func RunTicker() {
@ -18,7 +20,7 @@ func RunTicker() {
go func() {
for range unUsedSessionTicker.C {
sessions, _ := model.FindSessionByStatusIn([]string{constant.NoConnect, constant.Connecting})
if sessions != nil && len(sessions) > 0 {
if sessions != nil {
now := time.Now()
for i := range sessions {
if now.Sub(sessions[i].ConnectedTime.Time) > time.Hour*1 {
@ -51,7 +53,7 @@ func RunTicker() {
return
}
if sessions != nil && len(sessions) > 0 {
if sessions != nil {
var sessionIds []string
for i := range sessions {
sessionIds = append(sessionIds, sessions[i].ID)