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

Struct literals are not broken down if there are already line breaks #131

Open
bgimby opened this issue May 16, 2024 · 0 comments · May be fixed by #132
Open

Struct literals are not broken down if there are already line breaks #131

bgimby opened this issue May 16, 2024 · 0 comments · May be fixed by #132

Comments

@bgimby
Copy link

bgimby commented May 16, 2024

golines currently leaves this alone, even though it correctly tags it with a shorten annotation:

var _ = &mybigtype{
	arg1: "biglongstring1", arg2: longfunctioncall(param1), arg3: []string{"list1"}, arg4: bigvariable,
}
% golines  _fixtures/struct_split.go --keep-annotations
var _ = &mybigtype{
	// __golines:shorten:103
	arg1: "biglongstring1", arg2: longfunctioncall(param1), arg3: []string{"list1"}, arg4: bigvariable,
}

Ideally, it should split each arg onto its own line:

var _ = &mybigtype{
	arg1: "biglongstring1",
	arg2: longfunctioncall(param1),
	arg3: []string{"list1"},
	arg4: bigvariable,
}
@bgimby bgimby linked a pull request May 16, 2024 that will close this issue
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