Skip to content

Conversation

@Ak-Army
Copy link

@Ak-Army Ak-Army commented Apr 4, 2024

If real-statement-check is true this linter expects an enter if there is a real statement in the previous line, but forbids an enter if there is only a statement closure.

Examples of incorrect code:

func fooa() int {
    o := []int{0, 1}
    return o[0]
}

func foob(s string) *a {
    o := &a{
       a: s,
    }
	
    return o
}

func fooc() int {
    defer bar()
    return 0
}

func fooe(s string) interface{} {
    o := foob(
        s,
    )
	
    return o
}

Examples of correct code:

func fooa() int {
    o := []int{0, 1}
	
    return o[0]
}

func foob(s string) *a {
    o := &a{
        a: s,
    }
    return o
}

func fooc() int {
    defer bar()
    
    return 0
}

func fooe(s string) interface{} {
    o := foob(
        s,
    )
    return o
}

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 this pull request may close these issues.

1 participant