From cad67d6921667422654b84046ce225636337d573 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Mon, 8 Jan 2024 23:51:53 +0800 Subject: [PATCH 1/3] demo go.mod --- demo/classfile_blog/gop_autogen.go | 8 ++++---- demo/classfile_hello/gop_autogen.go | 12 ++++++------ demo/go.mod | 7 +++++++ 3 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 demo/go.mod 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 => ../ From 394ea3033a494dd334ace76cc7e1152d2c8e5ab1 Mon Sep 17 00:00:00 2001 From: xushiwei Date: Mon, 8 Jan 2024 23:56:35 +0800 Subject: [PATCH 2/3] Build demo --- .github/workflows/go.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 80662c4..70ca2ea 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 ./... From 2cd203dbbeb640a5fb978c09f28da8c5d59c614b Mon Sep 17 00:00:00 2001 From: xushiwei Date: Mon, 8 Jan 2024 23:57:55 +0800 Subject: [PATCH 3/3] x --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 70ca2ea..e353154 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -26,7 +26,7 @@ jobs: go-version: ${{ matrix.go-version }} - name: Build - run: + run: | go build -v ./... cd demo go build -v ./...