Skip to content

feat: Wrap long dereferenced functions - #39

Open
VolkerLieber wants to merge 1 commit into
golangci:mainfrom
VolkerLieber:wrap-dereferenced-functions
Open

feat: Wrap long dereferenced functions#39
VolkerLieber wants to merge 1 commit into
golangci:mainfrom
VolkerLieber:wrap-dereferenced-functions

Conversation

@VolkerLieber

Copy link
Copy Markdown

What this does
Adds the dst.StarExpr traversal to formatExpr, instead of landing in the default case path.
This allows long function call expressions, whose result gets dereferenced directly, to be correctly wrapped.

Meaning

package fixtures

func testStarExpressions() {
	values = append(values, *newValueFromInputs(firstArgument, secondArgument, thirdArgument, fourthArgument, fifthArgument, sixthArgument))
	result := *buildResult(firstArgument, secondArgument, thirdArgument, fourthArgument, fifthArgument, sixthArgument, seventhArgument)
	short := *shortCall(argument1)
}

now gets formatted as

package fixtures

func testStarExpressions() {
	values = append(
		values,
		*newValueFromInputs(
			firstArgument,
			secondArgument,
			thirdArgument,
			fourthArgument,
			fifthArgument,
			sixthArgument,
		),
	)
	result := *buildResult(
		firstArgument,
		secondArgument,
		thirdArgument,
		fourthArgument,
		fifthArgument,
		sixthArgument,
		seventhArgument,
	)
	short := *shortCall(argument1)
}

@ldez
ldez self-requested a review July 15, 2026 13:54
@ldez ldez added the enhancement New feature or request label Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants