Skip to content

go/format: adds } #11276

Closed
Closed
@dvyukov

Description

The following program:

package main

import (
    "fmt"
    "go/format"
)

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

outputs:

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions