Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gofmt does not indent first line of multiline string #1643

Closed
gopherbot opened this issue Mar 26, 2011 · 2 comments
Closed

gofmt does not indent first line of multiline string #1643

gopherbot opened this issue Mar 26, 2011 · 2 comments

Comments

@gopherbot
Copy link
Contributor

by jimteeuwen:

What steps will reproduce the problem?
Run the code below through gofmt: gofmt -w test.go

What is the expected output?
package main

type T struct {
    V string
}

func main() {
    _ = T {
        `some test string spanning one line`,
    }

    _ = T {
        `some test string spanning
        multiple lines`,
    }
}

What do you see instead?
package main

type T struct {
    V string
}

func main() {
    _ = T {
        `some test string spanning one line`,
    }

    _ = T {
`some test string spanning
        multiple lines`,
    }
}

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
64 bit linux

Which revision are you using?  (hg identify)
3b4e9c85b643 weekly/weekly.2011-03-15
@rsc
Copy link
Contributor

rsc commented Mar 26, 2011

Comment 1:

It's worth noting that the multiline string rules in Go
are different than in Python.  The current formatting
makes it clear that the first line has no leading spaces
while the second one does.

Owner changed to @griesemer.

Status changed to Accepted.

@griesemer
Copy link
Contributor

Comment 2:

This issue was closed by revision 1afc37f.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants