Skip to content

x/tools/gopls/internal/analysis/modernize: minmax doesn't work with return statements #72830

Open
@dominikh

Description

@dominikh

gopls isn't emitting any diagnostics for the following code:

func Mymin(a, b int) int {
	if a < b {
		return a
	} else {
		return b
	}
}

but it could suggest replacing the if/else with return min(a, b).

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions