Brad,

Would you be open to consider a PR to add the "-s" flag support to 
goimports?

On Monday, June 12, 2017 at 9:56:06 AM UTC-7, bradfitz wrote:
>
> Use the tool that does what you want.
>
> We don't have to put all functionality into all binaries.
>
> If vim-go makes assumptions that one helper binary does all functionality, 
> yes, please fix vim-go.
>
> On Mon, Jun 12, 2017 at 9:12 AM, sergiyb via golang-nuts <
> golan...@googlegroups.com <javascript:>> wrote:
>
>> 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> 
>>> 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> 
>>>> wrote:
>>>>
>>>>> 2014-02-21 9:29 GMT+04:00 Brad Fitzpatrick <brad...@golang.org>:
>>>>> > 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
>>>>> jabber: va...@selfip.ru
>>>>>
>>>>
>>>>
>>> -- 
>> 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...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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