Skip to content

[1.0] Assignment check not recognized when inline #1362

@2bitProgammer

Description

@2bitProgammer

The following code produces two red squiggles, even though it is valid go https://play.golang.org/p/HB_wIfj-nk:

x := make(map[string]int)
x["foo"] = 1

if _, ok := x["foo"]; !ok {fmt.Println("Missing key 'foo'")}

If it is changed to multiple lines, the squiggles go away:

x := make(map[string]int)
x["foo"] = 1

if _, ok := x["foo"]; !ok {
   fmt.Println("Missing key 'foo'")
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions