Skip to content

Wrong if condition in schemas.go #147

Description

@lukedirtwalker

The following if condition
https://github.com/capnproto/go-capnproto2/blob/4a2d721f0c4b15f3e369dc4a82d604ef605d7da5/schemas/schemas.go#L114-L115
is wrong. The error is assigned to r.err but the check below is on err which was previously checked.
Not sure what the correct solution would be, probably the if should just check for r.err, or is the assignment to r.err wrong in the first place?

Found with go nilness analyzer (https://godoc.org/golang.org/x/tools/go/analysis/passes/nilness)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions