Re: [go-nuts] gosnip: run small snippets of Go code from the command line

2018-11-27 Thread Michael Ellis
This is convenient and useful. Thanks! On Tuesday, November 27, 2018 at 8:52:26 AM UTC-5, Ben Hoyt wrote: > > Good idea -- done! The goimports way is a bit more advanced and featureful > too. > > I love how all these little tools are basically just wrappers around a > library package which does

Re: [go-nuts] gosnip: run small snippets of Go code from the command line

2018-11-27 Thread Ben Hoyt
Good idea -- done! The goimports way is a bit more advanced and featureful too. I love how all these little tools are basically just wrappers around a library package which does all the work, so you can reuse them in your own code. -Ben On Sun, Nov 25, 2018 at 8:53 AM Sameer Ajmani wrote: > In

Re: [go-nuts] gosnip: run small snippets of Go code from the command line

2018-11-26 Thread Ben Hoyt
> > I've actually been using gomacro for this (testing a quick bit of syntax). > I have to import the std libs that I need (auto import would be nice if > it's not ambiguous), but it has nice output evaluation and state. > > https://github.com/cosmos72/gomacro > Ha, nice! You know, I think I remem

Re: [go-nuts] gosnip: run small snippets of Go code from the command line

2018-11-25 Thread Sameer Ajmani
Instead of writing your own logic to resolve missing imports, could you run the goimports tool? It will automatically select imports from the standard library and GOPATH. S On Sat, Nov 24, 2018 at 5:06 PM Ben Hoyt wrote: > I just finished a little tool called "gosnip" that allows you to run > l

Re: [go-nuts] gosnip: run small snippets of Go code from the command line

2018-11-24 Thread Justin Israel
On Sun, Nov 25, 2018, 11:06 AM Ben Hoyt wrote: > I just finished a little tool called "gosnip" that allows you to run > little snippets of Go code from the command line: > > https://github.com/benhoyt/gosnip > > To use it, just type something like: > > $ gosnip 'fmt.Println("Hello world")' >