Skip to content

reword "declared and not used" warning #1619

@alexbrainman

Description

@alexbrainman
What steps will reproduce the problem?

this program will compile:

package main

func main() {
    var a int
    a += 2
}

while this one will not:

package main

func main() {
    var a int
    a = 2
}

test.go:4: a declared and not used

Which compiler are you using (5g, 6g, 8g, gccgo)?
8g

Which operating system are you using?
linux

Which revision are you using?  (hg identify)
35153fc8dd30+ tip

Please provide any additional information below.
I'm not sure if it is a problem, or if anything can be done about it. But it looks odd
to me.

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