8000 Support to cuddle assignments for a whole block · Issue #24 · bombsimon/wsl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Support to cuddle assignments for a whole block #24
Closed
@bombsimon

Description

@bombsimon

Right now you have to use the variable, type or field in the first statement in a block if you want to use it like this:

variable := "assigned"
[token] {
    // Must use 'variable' here
}

I think this is reasonable for most of the time but I kind of like to be able to use this pattern, especially if it's spawning a go routine like this:

done := make(chan struct{})
go func() {
    fmt.Println("Let's spawn this go routine")
    <-somethingBlocking

    close(done)
}()

// Wait for done
<-done

This might be useful in more scenarios like ranges, if-statements etcetera and therefore could possible be configured. Although as of now the only place I really felt that this was needed was a very few go routines.

Since this linter isn't really embrarcing any kind of official best practices like pythons black I think it's ok to have the linter heavily configurable like e.g. perltidy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    configurableThis option should be configurable (not default)golangci-onlyFixed in wsl but not merged to golangci-lint

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0