gospal
gospal copied to clipboard
_unexported_ channels
_unexported_ channels sometimes appear in inferred types by migoinfer. This should not happen.
MWE from Marko Gašparič:
package main
import (
"os/exec"
)
type Watchdog struct {
isRunning bool
done chan bool
Command *exec.Cmd
}
func (w *Watchdog) Stop() {
if !w.isRunning {
return
}
w.Command.Process.Kill()
close(w.done)
w.isRunning = false
}
func main() {
var w Watchdog
w.isRunning = true
w.done = make(chan bool)
w.Stop()