Code is looked at by more than just your favorite editor. I know some 
people who still open up Notepad to do some quick edits. I cat code all the 
time. gofmt ensures that every way you look at the code, be it through a 
terminal, one or two lines at a time, a web browser, a diff tool, or the 
most decked out editor out there, the code looks the same.

On a daily basis, I look at code in at least 5 different tools, of which I 
have full control over just two. I'd pay the costs that gofmt requires to a 
diff output to ensure that the code looks the same in every viewer.

On Thursday, January 30, 2020 at 8:50:36 AM UTC-5, Manlio Perillo wrote:
>
> Of course the tab is elastic **only** for a struct fields.  gofmt will 
> continue to format other code normally.
> Struct fields are the only block of code that gofmt will align 
> automatically, and the alignment may change is you add or remove a field.
>
> Manlio Perillo
>
> On Thursday, January 30, 2020 at 2:46:59 PM UTC+1, Manlio Perillo wrote:
>>
>> Yes.
>>
>> In fact I wrote that alignment should be done by the editor, not gofmt.
>>
>>
>> Manlio Perillo
>>
>> On Thursday, January 30, 2020 at 1:46:37 AM UTC+1, kortschak wrote:
>>>
>>> I suspect Manlio was referring to something like this 
>>> http://nickgravgaard.com/elastic-tabstops/. 
>>>
>>> Dan 
>>>
>>> On Thu, 2020-01-30 at 01:10 +0100, Wojciech S. Czarnecki wrote: 
>>> > Dnia 2020-01-29, o godz. 09:56:35 
>>> > Manlio Perillo <manlio...@gmail.com> napisaƂ(a): 
>>> > 
>>> > > What I propose is to use a tab between the field name and type. 
>>> > > It is responsibility of the editor or html formatter to align the 
>>> > > code. 
>>> > 
>>> > This ("between") assumes an agreed constant width of the tab 
>>> > representation. 
>>> > Ie. it will never work as intended in the field as people are using 
>>> > tabwidths from 2 to 8. 
>>> > 
>>> > > Manlio Perillo 
>>> > 
>>> > Hope this helps, 
>>> > 
>>> > -- 
>>> > Wojciech S. Czarnecki 
>>> >  << ^oo^ >> OHIR-RIPE 
>>> > 
>>> > -- 
>>> > 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 golan...@googlegroups.com. 
>>> > To view this discussion on the web visit 
>>> > 
>>> https://groups.google.com/d/msgid/golang-nuts/20200130011051.2e18a964%40xmint
>>>  
>>> > . 
>>>
>>>
>>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/93c86ff4-0237-4020-b8ea-b4265b7924b6%40googlegroups.com.

Reply via email to