v1.2.0-pre.1
Pre-release
Pre-release
features:
- cl: classExt: support
_[class].gox
or.[class]
(#1606 goplus/mod#42) - cl: go.mod support
//gop:class
to import a classfile (#1607 goplus/mod#45) - cl: gop.mod: allow to define multiple projects (#1602 goplus/mod#39)
- cl: gop.mod: gop.mod is no longer a superset of go.mod (#1602 #1605)
- cl: support var document (eg. //go:embed) (#1597)
- cl: mixed overload (#1562)
- cl: fnType support TyTemplateRecvMethod overload funcs (#1584)
- cl: add typesRecorder for types check (#1564 #1568)
- cl: goxRecorder.call for overload func (#1586)
- cl: types record support command call for overload (#1594)
- cl: update gox support interface overload method (#1592)
- cl: types record for FuncLit (#1571)
- cl: record compileRangeStmt defined (#1569)
- cl: compileForPhraseStmt types record define kv (#1575)
- cl: compileComprehensionExpr types record define kv (#1577)
- cl: compileLambdaExpr types record define names (#1579 #1599)
changes:
- gop install: contains @ version use remote pkgpath (#1566 #1570)
- cl: fix initGopPkg GopPackage type (#1588)
- cl: add conf.RelativeBase and rm conf.WorkingDir/TargetDir/FileLineRoot (#1595 #1603)
- use the latest tag version and append it with "devel" to signify the binary installation via source code (#1574)
- make: fix bugs when checking if symbolic link path exists (#1581)
- mod: github.com/qiniu/x v1.13.2
- mod: golang.org/x/tools v0.16.1
- mod: github.com/goplus/mod v0.12.2
- mod: github.com/goplus/gox v1.13.2
- mod: github.com/goplus/c2go v0.7.19
classfile examples:
Router and Parameters
demo in Go+ classfile (hello_yap.gox):
get "/p/:id", ctx => {
ctx.json {
"id": ctx.param("id"),
}
}
handle "/", ctx => {
ctx.html `<html><body>Hello, <a href="/p/123">Yap</a>!</body></html>`
}
run ":8080"
YAP Template
demo in Go+ classfile (blog_yap.gox, article.yap):
get "/p/:id", ctx => {
ctx.yap "article", {
"id": ctx.param("id"),
}
}
run ":8080"