sf1 / go-card

PC/SC client written in Go. Currently not maintained
MIT License
41 stars 23 forks source link

context for WaitForCardPresent #5

Closed Caledfwlch1 closed 3 years ago

Caledfwlch1 commented 4 years ago

Hello, Sebastian! Thank you very much for the package! Could you please add context to WaitForCardPresent method.

I expect something like this: ` func (ctx Context) WaitForCardPresent(pctx context.Context) (Reader, error) { var reader *Reader for reader == nil { select { case <-pctx.Done(): return nil, pctx.Err() default: }

`

sf1 commented 3 years ago

Hi, could you explain the use case? I am not sure what the motivation for another context is. Are you looking for something like a timeout or cancel feature?