Skip to content

golines may output invalid code when \n is present in a struct tag. #134

@EricIO

Description

@EricIO

For the input

package main

type Foo struct {
	Bar []string `parameter:"BAR" delimiter:"\n"`
}

golines will output the following invalid go code.

package main

type Foo struct {
	Bar []string `param:"CLIENT" delimiter:"
"`
}

Interestingly removing the first tag part will make golines output correctly formated code.

package main

type Foo struct {
	Bar []string `delimiter:"\n"`
}

outputs

package main

type Foo struct {
	Bar []string `delimiter:"\n"`
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions