diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 80662c4..e353154 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -26,7 +26,10 @@ jobs: go-version: ${{ matrix.go-version }} - name: Build - run: go build -v ./... + run: | + go build -v ./... + cd demo + go build -v ./... - name: Test run: go test -v -coverprofile="coverage.txt" -covermode=atomic ./... diff --git a/demo/classfile_blog/gop_autogen.go b/demo/classfile_blog/gop_autogen.go index 36d36c9..2f3641d 100644 --- a/demo/classfile_blog/gop_autogen.go +++ b/demo/classfile_blog/gop_autogen.go @@ -5,14 +5,14 @@ import "github.com/goplus/yap" type blog struct { yap.App } -//line demo/classfile_blog/blog_yap.gox:1 +//line classfile_blog/blog_yap.gox:1 func (this *blog) MainEntry() { -//line demo/classfile_blog/blog_yap.gox:1:1 +//line classfile_blog/blog_yap.gox:1:1 this.Get("/p/:id", func(ctx *yap.Context) { -//line demo/classfile_blog/blog_yap.gox:2:1 +//line classfile_blog/blog_yap.gox:2:1 ctx.Yap__1("article", map[string]string{"id": ctx.Param("id")}) }) -//line demo/classfile_blog/blog_yap.gox:7:1 +//line classfile_blog/blog_yap.gox:7:1 this.Run__1(":8080") } func main() { diff --git a/demo/classfile_hello/gop_autogen.go b/demo/classfile_hello/gop_autogen.go index 67047ab..54e6ff0 100644 --- a/demo/classfile_hello/gop_autogen.go +++ b/demo/classfile_hello/gop_autogen.go @@ -5,19 +5,19 @@ import "github.com/goplus/yap" type hello struct { yap.App } -//line demo/classfile_hello/hello_yap.gox:1 +//line classfile_hello/hello_yap.gox:1 func (this *hello) MainEntry() { -//line demo/classfile_hello/hello_yap.gox:1:1 +//line classfile_hello/hello_yap.gox:1:1 this.Get("/p/:id", func(ctx *yap.Context) { -//line demo/classfile_hello/hello_yap.gox:2:1 +//line classfile_hello/hello_yap.gox:2:1 ctx.Json__1(map[string]string{"id": ctx.Param("id")}) }) -//line demo/classfile_hello/hello_yap.gox:6:1 +//line classfile_hello/hello_yap.gox:6:1 this.Handle("/", func(ctx *yap.Context) { -//line demo/classfile_hello/hello_yap.gox:7:1 +//line classfile_hello/hello_yap.gox:7:1 ctx.Html__1(`
Hello, Yap!`) }) -//line demo/classfile_hello/hello_yap.gox:10:1 +//line classfile_hello/hello_yap.gox:10:1 this.Run__1(":8080") } func main() { diff --git a/demo/go.mod b/demo/go.mod new file mode 100644 index 0000000..69808f5 --- /dev/null +++ b/demo/go.mod @@ -0,0 +1,7 @@ +module github.com/goplus/yap/demo + +go 1.18 + +require github.com/goplus/yap v0.6.0 //gop:class + +replace github.com/goplus/yap => ../