aboutsummaryrefslogtreecommitdiff
path: root/plugin/done.go
blob: 3f53273dadeb2fff054d46786812b83306d08060 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package plugin

import "context"

// Done is a non-blocking function that returns true if the context has been canceled.
func Done(ctx context.Context) bool {
	select {
	case <-ctx.Done():
		return true
	default:
		return false
	}
	return false
}