Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demo go.mod #14

Merged
merged 3 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./...
Expand Down
8 changes: 4 additions & 4 deletions demo/classfile_blog/gop_autogen.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
12 changes: 6 additions & 6 deletions demo/classfile_hello/gop_autogen.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(`<html><body>Hello, <a href="/p/123">Yap</a>!</body></html>`)
})
//line demo/classfile_hello/hello_yap.gox:10:1
//line classfile_hello/hello_yap.gox:10:1
this.Run__1(":8080")
}
func main() {
Expand Down
7 changes: 7 additions & 0 deletions demo/go.mod
Original file line number Diff line number Diff line change
@@ -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 => ../
Loading