On Tue, Sep 13, 2022 at 10:46 PM David Finkel <david.fin...@gmail.com>
wrote:

> On Tue, Sep 13, 2022 at 3:55 PM Moein Halvaei <moeinn....@gmail.com>
> wrote:
>
>> When I read codes from https://cs.opensource.google/go, indents are 2
>> spaces and when using gofmt indents are 2 tabs. Why?
>>
> Google's Codesearch defaults to matching Google's C++ style guide rather
> than Go's recommended style:
> https://google.github.io/styleguide/cppguide.html#Spaces_vs._Tabs
> To be clear: gofmt uses an 8-spaces per tab, not two tabs.
>

gofmt doesn't determine how many spaces are tab stops aligned to at all.
That's a property of your editor, IDE or code browser and usually
configurable. That's part of the appeal of using tabs for indentation and
why spaces are better for alignment.


> --
>> 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/3b43a2be-8001-4f53-a952-417b6a909bd9n%40googlegroups.com
>> <https://groups.google.com/d/msgid/golang-nuts/3b43a2be-8001-4f53-a952-417b6a909bd9n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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/CANrC0BgCHM_m2nkAjkqnLDP02-FfYFtOyRv9SW8SAup4NHp1UA%40mail.gmail.com
> <https://groups.google.com/d/msgid/golang-nuts/CANrC0BgCHM_m2nkAjkqnLDP02-FfYFtOyRv9SW8SAup4NHp1UA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAEkBMfFf33V8JwGAWi6ibFUCzzb%2B7nSHKQA3dgO2xA2sOPMQ0A%40mail.gmail.com.

Reply via email to