Skip to content

Commit

Permalink
use proto.Message instead of custom interface
Browse files Browse the repository at this point in the history
  • Loading branch information
bosorawis committed Feb 19, 2025
1 parent 59426ba commit 748a968
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions internal/daemon/controller/handlers/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@ import (

"github.com/stretchr/testify/require"
"golang.org/x/exp/slices"
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/proto"
)

type protoReflector interface {
ProtoReflect() protoreflect.Message
}

// assertOutputFields asserts that the output fields of a group match the expected fields
// fields that is nil or empty in the result will throw an error if they are listed in expectedFields
// e.g. members when group does not contian any members

Check failure on line 16 in internal/daemon/controller/handlers/testing.go

View workflow job for this annotation

GitHub Actions / Run Linter

`contian` is a misspelling of `contain` (misspell)
func AssertOutputFields(t *testing.T, p protoReflector, expectFields []string) {
func AssertOutputFields(t *testing.T, p proto.Message, expectFields []string) {
msg := p.ProtoReflect()
descriptor := msg.Descriptor()
for i := 0; i < descriptor.Fields().Len(); i++ {
Expand Down

0 comments on commit 748a968

Please sign in to comment.