golang实现三层go routine context cancel

答案解析

通过父context派生子context,三层嵌套。父cancel后,所有子context会自动cancel,实现级联取消。常用context.WithCancel实现。