Skip to content

Tag alignment issue #48

@nikcorg

Description

@nikcorg

I've found a slight issue in tags alignment.

When a block where any line has more than one tag, the tags are correctly aligned. However, if the block is then altered so that only one tag remains, I expected the tags to be realigned, but they are actually left as they are.

More details below:

$ golines --version
golines v0.7.0

When this is the starting point:

type demo struct {
	Thing string `bson:"thing" json:"thing"`
	Thang int    `json:"thang"`
}

Passing that to golines produces the expected result:

type demo struct {
	Thing string `bson:"thing" json:"thing"`
	Thang int    `             json:"thang"`
}

However, if I then remove the bson tag, I would expect the tags to again be realigned from:

type demo struct {
	Thing string ` json:"thing"`
	Thang int    `             json:"thang"`
}

Into:

type demo struct {
	Thing string `json:"thing"`
	Thang int    `json:"thang"`
}

But the actual result is the tags are left untouched by golines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions