This commit is contained in:
pengtao 2020-09-28 16:57:36 +08:00
parent 0a0a60da6c
commit 2a3a1aa776
5 changed files with 19 additions and 18 deletions

View File

@ -1,3 +1,3 @@
appname = devops appname = go_ops
httpport = 8080 httpport = 8080
runmode = dev runmode = dev

6
go.mod
View File

@ -3,4 +3,8 @@ module go_ops
go 1.15 go 1.15
require github.com/astaxie/beego v1.12.1 require github.com/astaxie/beego v1.12.1
require github.com/smartystreets/goconvey v1.6.4
require (
github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18 // indirect
github.com/smartystreets/goconvey v1.6.4
)

View File

@ -1,11 +1,10 @@
package main package main
import ( import (
_ "devops/routers"
"github.com/astaxie/beego" "github.com/astaxie/beego"
_ "go_ops/routers"
) )
func main() { func main() {
beego.Run() beego.Run()
} }

View File

@ -1,8 +1,8 @@
package routers package routers
import ( import (
"devops/controllers"
"github.com/astaxie/beego" "github.com/astaxie/beego"
"go_ops/controllers"
) )
func init() { func init() {

View File

@ -1,12 +1,12 @@
package test package test
import ( import (
_ "go_ops/routers"
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
"testing"
"runtime"
"path/filepath" "path/filepath"
_ "devops/routers" "runtime"
"testing"
"github.com/astaxie/beego" "github.com/astaxie/beego"
. "github.com/smartystreets/goconvey/convey" . "github.com/smartystreets/goconvey/convey"
@ -18,7 +18,6 @@ func init() {
beego.TestBeegoInit(apppath) beego.TestBeegoInit(apppath)
} }
// TestBeego is a sample to run an endpoint test // TestBeego is a sample to run an endpoint test
func TestBeego(t *testing.T) { func TestBeego(t *testing.T) {
r, _ := http.NewRequest("GET", "/", nil) r, _ := http.NewRequest("GET", "/", nil)
@ -36,4 +35,3 @@ func TestBeego(t *testing.T) {
}) })
}) })
} }