nil signals are probably just a cancellation in disguise

This commit is contained in:
Adrien Delorme 2019-05-06 15:29:59 +02:00
parent 583d93790f
commit af15ed3583
1 changed files with 5 additions and 0 deletions

View File

@ -38,6 +38,11 @@ func (c *BuildCommand) Run(args []string) int {
go func() {
select {
case sig := <-sigCh:
if sig == nil {
// context got cancelled and this closed chan probably
// triggered first
return
}
c.Ui.Error(fmt.Sprintf("Cancelling build after receiving %s", sig))
cancelBuildCtx()
case <-buildCtx.Done():