-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
go: Add runnables #12110
go: Add runnables #12110
Conversation
This adds support for runnables to Go. It adds the following tasks: - `go test $ZED_GO_PACKAGE -run $ZED_SYMBOL` - `go test $ZED_GO_PACKAGE` - `go test ./...` - `go run $ZED_GO_PACKAGE` if it has a `main` function
label: format!("go run {}", GO_PACKAGE_TASK_VARIABLE.template_value(),), | ||
command: "go".into(), | ||
args: vec!["run".into(), GO_PACKAGE_TASK_VARIABLE.template_value()], | ||
tags: vec!["go-main".to_owned()], | ||
..TaskTemplate::default() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@osiewicz I assume it's not possible yet, but: is it possible for this task to only show up if there is something tagged with go-main
? I only add the tag in the runnables.scm
if there is a func main()
, but this shows up everywhere. I don't think it's a blocker, because you can run packages without being on the main
function, but still curious.
This looks very useful! However, my shell is
|
Hey Joe, |
Thanks for your hard working, could you tell me how to add custom flags to 'go test', eg: 'go test -v -count=1 ...' |
This adds support for runnables to Go.
It adds the following tasks:
go test $ZED_GO_PACKAGE -run $ZED_SYMBOL
go test $ZED_GO_PACKAGE
go test ./...
go run $ZED_GO_PACKAGE
if it has amain
functionRelease Notes:
main
functions.Demo:
screenshot-2024-05-22-07.06.28.mp4
screenshot-2024-05-22-07.17.04.mp4