FAQ
Hello,

I think it's a stupid thing, but ... I just realized that in case of //
comments, gofmt doesn't put a blank space at the beginning before the text.

For example:

//this is a test , I was expecting gofmt to format it as // this is a test
(so putting a blank space at the beginning between // and this).
I was expecting it since I see it's basically the "effective
<https://golang.org/doc/effective_go.html#commentary>" way of writing
comments.


Is it normal that gofmt doesn't consider this blank space? It would be nice
to have it.

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Ian Lance Taylor at Oct 20, 2015 at 10:19 pm

    On Tue, Oct 20, 2015 at 2:39 PM, Alessandro Baffa wrote:

    I think it's a stupid thing, but ... I just realized that in case of //
    comments, gofmt doesn't put a blank space at the beginning before the text.

    For example:

    //this is a test , I was expecting gofmt to format it as // this is a test
    (so putting a blank space at the beginning between // and this).
    I was expecting it since I see it's basically the "effective" way of writing
    comments.


    Is it normal that gofmt doesn't consider this blank space? It would be nice
    to have it.
    This is working as intended. In particular, there are various magic
    comments that must appear with no space (see
    https://golang.org/cmd/compile) so changing this would break the Go
    standard library.

    Ian

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 20, '15 at 9:39p
activeOct 20, '15 at 10:19p
posts2
users2
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase