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

bug: raw literal with backslashes becomes "unescaped" #142

Open
dim0xff opened this issue Aug 11, 2024 · 0 comments · May be fixed by #143
Open

bug: raw literal with backslashes becomes "unescaped" #142

dim0xff opened this issue Aug 11, 2024 · 0 comments · May be fixed by #143

Comments

@dim0xff
Copy link

dim0xff commented Aug 11, 2024

golines removes "escaped" slashes

// bug.go
package bug

type Struct10 struct {
        Field2   int
        MyStruct any `json:"field"    validate:"\\d+"`
}

Output of golines bug.go:

// bug.go
package bug

type Struct10 struct {
        Field2   int
        MyStruct any `json:"field" validate:"\d+"`
}

Expected output (look at validate tag value):

// bug.go
package bug

type Struct10 struct {
        Field2   int
        MyStruct any `json:"field" validate:"\\d+"`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant