Skip to content

Effective Go - i declared but not used in 2 ranges. #2481

@boslandm

Description

@boslandm
What steps will reproduce the problem?  Documentation only.

What is the expected output?
for _, s := range os.Args {
        fmt.Println(s)
}
and
for _, s := range os.Args {
        fmt.Fprintln(w, s)
}

What do you see instead?
for i, s := range os.Args {
        fmt.Println(s)
}
and
for i, s := range os.Args {
        fmt.Fprintln(w, s)
}

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