Skip to content

v1.4.0

Latest

Choose a tag to compare

@dolmen dolmen released this 13 Apr 16:31

New features

  • Added flag -o to build a binary from your snippet (#15, #16)
  • Improved handling of arguments:
    • with -E arguments are rejected instead of being ignored
    • with -play, -Eplay, -share the arguments are injected into the source with an init block that populates os.Args
  • A new build tag goeval.offline allows to build a light version of goeval that removes features related to the Go Playground (-play, -share...).
    • Features: faster build/install, smaller binary, reduced risk of leak to the Go Playground via goeval.
    • Use case: automating tasks in a script (Makefile, Dockerfile or //go:generate).
    • How to build? go install -tags=goeval.offline github.com/dolmen-go/goeval@v1.4.0
  • Shebang support on stdin: goeval now skips a shebang (#!) line when reading source code from standard input.

Improvements and Fixes

  • Error handling:
    • -play and -share now have improved error reporting.
    • -play now returns an exit status of 1 if compilation fails on the Go Playground.
    • Fixed error reporting when multiple packages are specified with -i (using comma).
  • Environment: Fixed protection against GOMOD environment variable interference.
  • User-Agent: Fixed version fallback in the User-Agent string when build information is missing (ex: running via go run which set -buildvcs=false).

Documentation

  • Major overhaul of the README for better clarity and project overview.
  • Added more installation alternatives in README.
  • Added reference to the goplay tool.
  • Added new examples: Example_play, Example_playWithArgs, and Example_compileError.

Internal