1
0
Fork 0
mirror of https://github.com/sourcegraph/jsonrpc2.git synced 2026-06-18 13:10:02 +02:00

Add StringID call option (#44)

Fixes #43
This commit is contained in:
Sam Herrmann 2021-04-26 03:12:26 -04:00 committed by GitHub
parent 366fbb5207
commit 08fd77d0de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 109 additions and 47 deletions

View file

@ -28,3 +28,12 @@ func PickID(id ID) CallOption {
return nil
})
}
// StringID returns a call option that instructs the request ID to be set as a
// string.
func StringID() CallOption {
return callOptionFunc(func(r *Request) error {
r.ID.IsString = true
return nil
})
}