Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This gives me hope to ease running Go code for CI jobs directly from GitHub workflow YAML files using goeval [1].

However goeval doesn't yet have direct support for file input (only stdin), so shell tricks are needed.

So far the way is:

  run: |
    go run github.com/dolmen-go/goeval@v1 - <<'EOF'
    fmt.Println("Hello")
    EOF
but this requires a bit of boilerplate.

Disclaimer: I'm the author of goeval.

[1] https://github.com/dolmen-go/goeval



Why do you need any shell "tricks"? Wouldn't this work?

     go run github.com/dolmen-go/goeval@v1 - < file.go


I believe the difference is that in your example file.go needs to live in the repo (or created by a previous step:) whereas reading from stdin allows writing the logic in the .yaml itself, and thus is subject to uses: or other reuse tricks


Sure. But the previous post seemed to suggest that tricks were needed because goeval doesn't support reading from files.


I'm trying to use goeval as a GitHub workflow shell, as this is the subject of the blog post.

GitHub requreq {0} to be present on the shell line.


I went to the repo to find out if your program automatically converted spaces into tabs but it seems it is more oriented toward oneliner expressions

If you're going to plug your toy in this context, showing something more relevant than "print hello" would have saved me the click




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: