This is still bothering us in 2017. I'd love to be able to run goimports on 
save in Vim, but also would like to simplify code (-s option). I use vim-go 
plugin, so I guess I can submit a pull request asking the plugin to run 
both commands on save, but I do not understand why the workaround instead 
of command parity? Is it something no one has had time to look into yet or 
is it too hard to implement with current goimports implementation?

On Friday, February 21, 2014 at 6:36:59 AM UTC+1, bradfitz wrote:
>
> Oh, you did update goimports.
>
> gofmt and goimports both had their tab options removed.
>
> But yes, goimports doesn't have cpuprofile, -r, or -s.  Not sure how much 
> it matters.  No editors really use those, do they?  If you want to do it by 
> hand, gofmt is still there.
>
>
>
> On Thu, Feb 20, 2014 at 9:35 PM, Brad Fitzpatrick <brad...@golang.org 
> <javascript:>> wrote:
>
>> I don't think you're running the correct binary then, because:
>>
>> $ rm $(which goimports)
>> $ go get -v -u code.google.com/p/go.tools/cmd/goimports
>> $ goimports -h
>> usage: goimports [flags] [path ...]
>>   -d=false: display diffs instead of rewriting files
>>   -e=false: report all errors (not just the first 10 on different lines)
>>   -l=false: list files whose formatting differs from goimport's
>>   -w=false: write result to (source) file instead of stdout
>>
>>
>>
>> On Thu, Feb 20, 2014 at 9:32 PM, Vasiliy Tolstov <v.to...@selfip.ru 
>> <javascript:>> wrote:
>>
>>> 2014-02-21 9:29 GMT+04:00 Brad Fitzpatrick <brad...@golang.org 
>>> <javascript:>>:
>>> > You're running old binaries of each.
>>>
>>>
>>> Hmm. I'm try new goimports but nothing different:
>>>
>>> go get -v -x -u code.google.com/p/go.tools/cmd/goimports
>>> code.google.com/p/go.tools (download)
>>> cd /home/vtolstov/devel/go/src/code.google.com/p/go.tools
>>> hg pull
>>> cd /home/vtolstov/devel/go/src/code.google.com/p/go.tools
>>> hg tags
>>> cd /home/vtolstov/devel/go/src/code.google.com/p/go.tools
>>> hg branches
>>> cd /home/vtolstov/devel/go/src/code.google.com/p/go.tools
>>> hg update default
>>> WORK=/tmp/go-build706264051
>>> code.google.com/p/go.tools/imports
>>> mkdir -p $WORK/code.google.com/p/go.tools/imports/_obj/
>>> mkdir -p $WORK/code.google.com/p/go.tools/
>>> cd /home/vtolstov/devel/go/src/code.google.com/p/go.tools/imports
>>> /usr/lib64/go/pkg/tool/linux_amd64/6g 
>>> <http://code.google.com/p/go.tools/imports/usr/lib64/go/pkg/tool/linux_amd64/6g>
>>>  
>>> -o
>>> $WORK/code.google.com/p/go.tools/imports/_obj/_go_.6 -p
>>> code.google.com/p/go.tools/imports -complete -D
>>> _/home/vtolstov/devel/go/src/code.google.com/p/go.tools/imports -I
>>> $WORK -I /home/vtolstov/devel/go/pkg/linux_amd64 ./fix.go ./imports.go
>>> ./sortimports.go ./zstdlib.go
>>> /usr/lib64/go/pkg/tool/linux_amd64/pack grcP $WORK
>>> $WORK/code.google.com/p/go.tools/imports.a
>>> $WORK/code.google.com/p/go.tools/imports/_obj/_go_.6
>>> mkdir -p /home/vtolstov/devel/go/pkg/linux_amd64/
>>> code.google.com/p/go.tools/
>>> cp $WORK/code.google.com/p/go.tools/imports.a
>>> /home/vtolstov/devel/go/pkg/linux_amd64/
>>> code.google.com/p/go.tools/imports.a
>>> code.google.com/p/go.tools/cmd/goimports
>>> mkdir -p $WORK/code.google.com/p/go.tools/cmd/goimports/_obj/
>>> mkdir -p $WORK/code.google.com/p/go.tools/cmd/goimports/_obj/exe/
>>> cd /home/vtolstov/devel/go/src/code.google.com/p/go.tools/cmd/goimports
>>> /usr/lib64/go/pkg/tool/linux_amd64/6g 
>>> <http://code.google.com/p/go.tools/cmd/goimports/usr/lib64/go/pkg/tool/linux_amd64/6g>
>>>  
>>> -o
>>> $WORK/code.google.com/p/go.tools/cmd/goimports/_obj/_go_.6 -p
>>> code.google.com/p/go.tools/cmd/goimports -complete -D
>>> _/home/vtolstov/devel/go/src/code.google.com/p/go.tools/cmd/goimports
>>> -I <http://code.google.com/p/go.tools/cmd/goimports-I> $WORK -I
>>> /home/vtolstov/devel/go/pkg/linux_amd64 ./doc.go ./goimports.go
>>> /usr/lib64/go/pkg/tool/linux_amd64/pack grcP $WORK
>>> $WORK/code.google.com/p/go.tools/cmd/goimports.a
>>> $WORK/code.google.com/p/go.tools/cmd/goimports/_obj/_go_.6
>>> cd .
>>> /usr/lib64/go/pkg/tool/linux_amd64/6l -o
>>> $WORK/code.google.com/p/go.tools/cmd/goimports/_obj/exe/a.out -L $WORK
>>> -L /home/vtolstov/devel/go/pkg/linux_amd64
>>> $WORK/code.google.com/p/go.tools/cmd/goimports.a
>>> mkdir -p /home/vtolstov/bin/
>>> cp $WORK/code.google.com/p/go.tools/cmd/goimports/_obj/exe/a.out
>>> /home/vtolstov/bin/goimports 
>>> <http://code.google.com/p/go.tools/cmd/goimports/_obj/exe/a.out/home/vtolstov/bin/goimports>
>>>
>>> /home/vtolstov/bin/goimports --help
>>> usage: goimports [flags] [path ...]
>>>   -d=false: display diffs instead of rewriting files
>>>   -e=false: report all errors (not just the first 10 on different lines)
>>>   -l=false: list files whose formatting differs from goimport's
>>>   -w=false: write result to (source) file instead of stdout
>>>
>>>
>>> --
>>> Vasiliy Tolstov,
>>> e-mail: v.to...@selfip.ru <javascript:>
>>> jabber: va...@selfip.ru <javascript:>
>>>
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to