Ask questionsTry out the new Go generics proposal with go-linq

Go now has a prototype of generics implementation. Here are some resources:


This potentially could give a severe performance boost to go-linq, as well as actually make this library useful.

I haven't taken a closer look at how we would do this yet. For example, we might still end up having to do some type assertions. However, it might help us redesign the package and release a v4 if the generics proposal is adopted.


Answer questions ahmetb

So I tried to imitate what From..Where..Select.. sort of thing would work. Each Where/Select/... would have different type parameters:

type Array[K any] []K

func (a Array[K]) Print[V any](v V) {
	for _, i := range a {

However this is not supported by design.


Related questions

No questions were found.
Ahmet Alp Balkan ahmetb Google Seattle, WA Senior software engineer at Google Cloud, on cloud-native technologies: Kubernetes/GKE and Cloud Run.
Github User Rank List