Skip to content

Issue with channels of structure type #2112

Closed
@stanislav-bios-baranov

Description

@stanislav-bios-baranov

With the following snippet, Idea highlights TestField inside 'for' loop as unrecognized, while code is correct and compiles. (This example will not work, when run, but it is only to demonstrate issue)

package main

import "fmt"

type TestStruct struct {
    TestField string
}

func GetChan() <- chan TestStruct {
    return make(chan TestStruct)
}

func main() {
    testChan := GetChan()

    for data := range testChan {
        fmt.Println(data.TestField)
    }
}

Idea

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions