Release v0.6.50
Commands
qrun
Enhancement: run <gopSrcFile>
as a Go+ script. See qrun for more detail.
Thanks contribution of jiangz222 (jiangzhi@goplus.org).
qfmt
Format Go+ packages, similar to go fmt
. See qfmt for more detail.
Usage: qfmt [flags] [path ...]
-w write result to (source) file instead of stdout
Thanks contribution of visualfc (visualfc@goplus.org), damonchen.
qexp
Generate a Go+ package that wraps a Go package automatically. See qexp for more detail.
Usage: qexp <goPkgPath>
Thanks contribution of xushiwei (x@goplus.org), visualfc (visualfc@goplus.org).
Unix shebang
You can use Go+ programs as shell scripts now. For example:
#!/usr/bin/env qrun
println("Hello, Go+")
println(1r << 129)
println(1/3r + 2/7r*2)
arr := [1, 3, 5, 7, 11, 13, 17, 19]
println(arr)
println([x*x for x <- arr, x > 3])
m := {"Hi": 1, "Go+": 2}
println(m)
println({v: k for k, v <- m})
println([k for k, _ <- m])
println([v for v <- m])
Go tutorial/20-Unix-Shebang/shebang to get the source code.
Thanks contribution of jiangz222 (jiangzhi@goplus.org).
Playground
All playgrounds support Go+ code formatting now.
- Playground based on GopherJS: https://qiniu.github.io/goplus-play/
- Playground based on Docker: https://play.goplus.org/
Thanks contribution of visualfc (visualfc@goplus.org), qiukeren (qiukeren@goplus.org).
For loop
Thanks contribution of JessonChan (chendongpo@goplus.org)
sum := 0
x := 0
for _, x = range [1, 3, 5, 7, 11, 13, 17] {
if x > 3 {
sum += x
}
}
println("sum(5,7,11,13,17):", sum)
Flow control
- fallthrough
Thanks contribution of JessonChan (chendongpo@goplus.org)
Miscs
- Enrich pre-commit hooks and call them from Travis CI.
- Call gofmt at git commit time.
Thanks contribution of wangkuiyi.