It will be great is eg can support generics in a way it can handle e.g. slices of different types.
Example: Replacing a method that takes slices of elements that implements given interface.
package template
import (
"github.com/golang/protobuf/proto"
"github.com/stackrox/rox/pkg/protoassert"
"github.com/stretchr/testify/assert"
"testing"
)
func before[T proto.Message](t *testing.T, a, b []T) bool {
return assert.Equal(t, a, b)
}
func after[T proto.Message](t *testing.T, a, b []T) bool {
return protoassert.SlicesEqual(t, a, b)
}
Proposal Details
It will be great is eg can support generics in a way it can handle e.g. slices of different types.
Example: Replacing a method that takes slices of elements that implements given interface.