瀏覽代碼

update to v1.2.11

cg33 6 年之前
父節點
當前提交
82238d92e2
共有 2 個文件被更改,包括 8 次插入0 次删除
  1. 4 0
      main.go
  2. 4 0
      main_test.go

+ 4 - 0
main.go

@@ -23,6 +23,10 @@ import (
 )
 
 func main() {
+	startServer()
+}
+
+func startServer() {
 	gin.SetMode(gin.ReleaseMode)
 	gin.DefaultWriter = ioutil.Discard
 

+ 4 - 0
main_test.go

@@ -8,6 +8,7 @@ import (
 	"github.com/GoAdminGroup/go-admin/tests/frameworks/gin"
 	"github.com/GoAdminGroup/go-admin/tests/web"
 	"github.com/gavv/httpexpect"
+	"log"
 	"testing"
 )
 
@@ -43,5 +44,8 @@ func TestExampleUserAcceptance(t *testing.T) {
 	}, func(quit chan struct{}) {
 		// start the server:
 		// ....
+		go startServer()
+		<-quit
+		log.Print("test quit")
 	}, true) // if local parameter is true, it will not be headless, and window not close when finishing tests.
 }