Skip to content

spec: inconsistency in handling declaration of blank identifier #7504

@robpike

Description

@robpike
This compiles:

package main

func main() {
  var _ = 5
}

This does not:

package main

func main() {
  _ := 5
}

I can't see a reason to allow the first but not the second. I vote for disallowing the
first.

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