Skip to content

Commit c839aee

Browse files
committed
Implement EmptyCallOption
1 parent 1c69e4c commit c839aee

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rpc_util.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,14 @@ type CallOption interface {
159159
after(*callInfo)
160160
}
161161

162+
// EmptyCallOption does not alter the Call configuration.
163+
// It can be embedded in another structure to carry satellite data for use
164+
// by interceptors.
165+
type EmptyCallOption struct{}
166+
167+
type (EmptyCallOption) before(*callInfo) error { return nil }
168+
type (EmptyCallOption) after(*callInfo) {}
169+
162170
type beforeCall func(c *callInfo) error
163171

164172
func (o beforeCall) before(c *callInfo) error { return o(c) }

0 commit comments

Comments
 (0)