Skip to content

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

Open
@bgimby

Description

@bgimby

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,
}

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