-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathempty.go
17 lines (14 loc) · 818 Bytes
/
empty.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package state
import "context"
type emptyState struct{}
// Empty returns new empty State
func Empty() State { return emptyState{} }
func (e emptyState) Err() error { return nil }
func (e emptyState) Shutdown(_ context.Context) error { return nil }
func (e emptyState) Wait() {}
func (e emptyState) Ready() <-chan struct{} { return closedchan }
func (e emptyState) Value(_ interface{}) interface{} { return nil }
func (e emptyState) DependsOn(children ...State) State { return withDependency(e, children...) }
func (e emptyState) close() {}
func (e emptyState) finishSig() <-chan struct{} { return closedchan }
func (e emptyState) cause() error { return nil }