Skip to content

Commit

Permalink
asm: rename ErrUnsatisfied{,Program}Reference
Browse files Browse the repository at this point in the history
The error string was changed when it was exported in cilium#541 and is potentially
ambiguous.

Signed-off-by: Timo Beckers <timo@isovalent.com>
  • Loading branch information
ti-mo committed Feb 16, 2022
1 parent 7b01b44 commit 9f235dc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions asm/instruction.go
Expand Up @@ -20,7 +20,7 @@ const InstructionSize = 8
type RawInstructionOffset uint64

var ErrUnsatisfiedMapReference = errors.New("unsatisfied map reference")
var ErrUnsatisfiedReference = errors.New("unsatisfied reference")
var ErrUnsatisfiedProgramReference = errors.New("unsatisfied program reference")

// Bytes returns the offset of an instruction in bytes.
func (rio RawInstructionOffset) Bytes() uint64 {
Expand Down Expand Up @@ -584,7 +584,7 @@ func (insns Instructions) FixupReferences() error {
// no fixup needed
continue
}
return fmt.Errorf("%s at insn %d: symbol %q: %w", ins.OpCode, i, ins.Reference, ErrUnsatisfiedReference)
return fmt.Errorf("%s at insn %d: symbol %q: %w", ins.OpCode, i, ins.Reference, ErrUnsatisfiedProgramReference)
}
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions linker_test.go
Expand Up @@ -74,8 +74,8 @@ func TestForwardFunctionDeclaration(t *testing.T) {

// This program calls an unimplemented forward function declaration.
_, err = NewProgram(spec)
if !errors.Is(err, asm.ErrUnsatisfiedReference) {
t.Fatal("Expected an error wrapping errUnsatisfiedProgram, got:", err)
if !errors.Is(err, asm.ErrUnsatisfiedProgramReference) {
t.Fatal("Expected an error wrapping ErrUnsatisfiedProgramReference, got:", err)
}

// Append the implementation of fwd().
Expand Down
2 changes: 1 addition & 1 deletion prog_test.go
Expand Up @@ -375,7 +375,7 @@ func TestProgramWithUnsatisfiedMap(t *testing.T) {

_, err = NewProgram(progSpec)
if !errors.Is(err, asm.ErrUnsatisfiedMapReference) {
t.Fatal("Expected an error wrapping errUnsatisfiedMapReference, got", err)
t.Fatal("Expected an error wrapping asm.ErrUnsatisfiedMapReference, got", err)
}
t.Log(err)
}
Expand Down

0 comments on commit 9f235dc

Please sign in to comment.