github.com/benhoyt/gosnip (go): Package gosnip is a tool that allows you to run small snippets of Go code from the command line.  For simple uses, just specify one or more Go statements on the command line, and gosnip will roll them into a full Go program and run the result using "go run". Standard library imports and any imports needed for packages in GOPATH are added automatically (using the same logic as the "goimports" tool). Some examples:  The -i flag allows you to specify an import explicitly, which may be needed to select between ambiguous stdlib imports such as "text/template" and "html/template" (multiple -i flags are allowed). For example:  The -d flag turns on debug mode, which prints the full program on stderr before running it. For example:  The gosnip command-line tool is a thin wrapper around the "sniplib" package. To run Go snippets in your Go programs, see the sniplib docs.
Keywords: code-snippets|command-line|go|tool