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

go/format: adds } #11276

dvyukov opened this issue Jun 18, 2015 · 2 comments

go/format: adds } #11276

dvyukov opened this issue Jun 18, 2015 · 2 comments


Copy link

dvyukov commented Jun 18, 2015

The following program:

package main

import (

func main() {
    data := []byte("\ta()\n//line :1")
    data1, err := format.Source(data)
    if err != nil {
    _, err = format.Source(data1)
    if err != nil {
        fmt.Printf("orig: %q\n", data)
        fmt.Printf("new : %q\n", data1)


orig: "\ta()\n//line :1"
new : "\ta() }\n\n//line"

} should not be added

go version devel +514014c Thu Jun 18 15:54:35 2015 +0200 linux/amd64

@ianlancetaylor ianlancetaylor added this to the Go1.5Maybe milestone Jun 19, 2015
Copy link

dspezia commented Jun 20, 2015

I have a fix (kind of), but it is not pretty. Submitting it for review.

Copy link

CL mentions this issue.

@mikioh mikioh modified the milestones: Go1.5, Go1.5Maybe Jun 24, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

6 participants