Skip to content

Goroutine leak #1

@cyongxue

Description

@cyongxue

func TimeoutCoder(f func(interface{}) error, e interface{}, msg string) error {
echan := make(chan error, 1)
go func() { echan <- f(e) }()
select {
case e := <-echan:
return e
case <-time.After(time.Minute):
return fmt.Errorf("Timeout %s", msg)
}
}

go func() { echan <- f(e) }(),this Goroutine leak。

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