Declare option not options

This commit is contained in:
Asim
2015-05-21 19:28:57 +01:00
parent 9d514f0e60
commit 4f909d0be4
4 changed files with 16 additions and 4 deletions

View File

@@ -16,12 +16,18 @@ type options struct {
transport transport.Transport
}
type Options func(*options)
type Option func(*options)
var (
DefaultClient Client = NewRpcClient()
)
func Transport(t transport.Transport) Option {
return func(o *options) {
o.transport = t
}
}
func Call(request Request, response interface{}) error {
return DefaultClient.Call(request, response)
}