Skip to content

[go-CAN-06] socketcan.New lacks a context.Context parameter, contrary to the spec's Form 1 transport constructor shape #78

Description

@SoundMatt

Location: socketcan/bus_linux.go:68 (func New(iface string) (*Bus, error)); README.md:65

Finding: RELAY §7 specifies that hardware/OS transports use a constructor of the form New(ctx context.Context, endpoint string, opts ...Option), with connection establishment required to honor the passed context. socketcan.New currently takes only iface string — there's no way for a caller to bound or cancel socket setup with a context, and the README's documented usage (socketcan.New("can0")) reflects the same non-conformant shape.

Recommendation: Change the signature to New(ctx context.Context, iface string, opts ...Option) and thread the context through the socket-setup path (at minimum, check ctx.Err() around blocking steps); update the README and any other examples to match.

Filed from the 2026-07-29 ecosystem audit register; independently re-verified against current HEAD before filing.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions