Tags: gotmc/asrl
Tags
Rename context methods to Binary and remove WriteStringContext Rename ReadContext to ReadBinary and WriteContext to WriteBinary to better reflect that these methods handle raw binary data without terminator interpretation. Remove WriteStringContext since callers can use WriteBinary directly with []byte conversion. Update Command to use WriteBinary accordingly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add context.Context parameter to NewDevice NewDevice now takes a context as its first parameter, consistent with Command, Query, and the rest of the API. Update all call sites in examples and example tests. Add pkgsite docs recipe to Justfile. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use Timer and Ticker for DSR polling instead of Sleep loop Replace manual time.Now/time.Sleep polling with time.NewTimer for the deadline and time.NewTicker for the polling interval, unified via select with ctx.Done(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix common Go mistakes across library and tests Remove log package usage from library code, letting callers handle logging. Propagate context into napIfDataSetNotReady to prevent unbounded blocking. Return errors from isDSR instead of silently logging. Return nil instead of shadowed err variable in Command. Compile VISA regex once at package level. Return nil on error paths in NewVisaResource instead of partial structs. Use subtests with t.Run and t.Parallel in tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PreviousNext