Skip to content

Channel assigned to a field of a stuct should result in a model error #9

@nicolasdilley

Description

@nicolasdilley

https://github.com/github/git-sizer/blob/951a51bd37e5e3454850d471b05d9d51d4851b74/git/git.go#L445

A common pattern is to assign a channel to a field of a struct and either call
a method on the struct which affects the channel in some way or returning the struct.

Potential fix:

check if the channel is used on the right side of an AssignStmt or a DeclStmt via a simple Ident and check if the left handside is a SelectorExpr or a CompositeList .
If it is just return a parseError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions