Skip to content

proposal: support "var identifier = _" to mute an identifier in certain scope. #17389

Closed
@zigo101

Description

@zigo101

This is helpful to avoid using some identifiers which should be used in some scopes carelessly.

Example:

package main

func main(){
    var n = 123,
    // use n

    {
        // use n

        var n = _
        // now n disppears
    }

    // here, n is still alive
    // use n
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions