-
Notifications
You must be signed in to change notification settings - Fork 547
Commands (to be updated)
xushiwei edited this page Aug 6, 2021
·
1 revision
gop run # Run a Go+ program
gop repl # Run Go+ in REPL/Console mode
gop go [-test] # Convert Go+ packages into Go packages. If -test specified, it tests related packages.
gop fmt # Format Go+ packages
gop export # Export Go packages for Go+ programs
Run <gopSrcDir|gopSrcFile> as a Go+ script.
Usage: gop run [-asm -quiet -debug -prof] <gopSrcDir|gopSrcFile>
-asm
generates `asm` code of Go+ bytecode backend
-debug
print debug information
-prof
do profile and generate profile report
-quiet
don't generate any compiling stage log
Here are some examples:
gop run <gopSrcDir|gopSrcFile> # gop run <gopSrcDir | gopSrcFile>
gop run -asm <gopSrcDir|gopSrcFile> # generates `asm` code of Go+ bytecode backend
gop run -quiet <gopSrcDir|gopSrcFile> # don't generate any compiling stage log
gop run -debug <gopSrcDir|gopSrcFile> # print debug information
gop run -prof <gopSrcDir|gopSrcFile> # do profile and generate profile report
Run Go+ in REPL/Console mode.
Usage: gop repl
Format Go+ packages.
Usage: gop fmt [-w] [path ...]
-w write result to (source) file instead of stdout
Generate a Go+ package that wraps a Go package automatically.
Usage: gop export [-outdir <outRootDir>] <goPkgPath>
-outdir string
optional set export lib path, default is $GoPlusRoot/lib path.
Convert all Go+ packages under <gopSrcDir> into Go packages, recursively.
Usage: gop go [-test] <gopSrcDir>
-test
test Go+ package
Here are some examples:
gop go <gopSrcDir> # gop go <gopSrcDir>
gop go -test <gopSrcDir>
Note:
-
gop go -test <gopSrcDir>
converts Go+ packages into Go packages, and for every package, it callgo run <gopPkgDir>/gop_autogen.go
andgop run -quiet <gopPkgDir>
to compare their outputs. If their outputs aren't equal, the test case fails.