all: upgrade golangci-lint and formatters (#240)
This commit is contained in:
committed by
GitHub
parent
553930530f
commit
72b8db9c80
@@ -7,9 +7,8 @@ import (
|
||||
"go/types"
|
||||
"strconv"
|
||||
|
||||
"github.com/mmcloughlin/avo/reg"
|
||||
|
||||
"github.com/mmcloughlin/avo/operand"
|
||||
"github.com/mmcloughlin/avo/reg"
|
||||
)
|
||||
|
||||
// Sizes provides type sizes used by the standard Go compiler on amd64.
|
||||
@@ -31,7 +30,6 @@ type Component interface {
|
||||
// during any previous calls to Component methods, they will be returned at
|
||||
// resolution time.
|
||||
Resolve() (*Basic, error)
|
||||
|
||||
Dereference(r reg.Register) Component // dereference a pointer
|
||||
Base() Component // base pointer of a string or slice
|
||||
Len() Component // length of a string or slice
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package gotypes
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"go/token"
|
||||
"go/types"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/mmcloughlin/avo/reg"
|
||||
|
||||
"github.com/mmcloughlin/avo/operand"
|
||||
"github.com/mmcloughlin/avo/reg"
|
||||
)
|
||||
|
||||
func TestBasicKindsArePrimitive(t *testing.T) {
|
||||
@@ -39,6 +39,7 @@ func TestPointersArePrimitive(t *testing.T) {
|
||||
}
|
||||
|
||||
func AssertPrimitive(t *testing.T, typ types.Type) {
|
||||
t.Helper()
|
||||
c := NewComponent(typ, operand.NewParamAddr("primitive", 0))
|
||||
if _, err := c.Resolve(); err != nil {
|
||||
t.Errorf("expected type %s to be primitive: got error '%s'", typ, err)
|
||||
@@ -92,7 +93,7 @@ func TestComponentErrorChaining(t *testing.T) {
|
||||
}
|
||||
for _, c := range cases {
|
||||
_, err := c.Resolve()
|
||||
if err != expect {
|
||||
if !errors.Is(err, expect) {
|
||||
t.Fatal("chaining should preserve error")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user