Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

go version 1.18 Generics, swag init failed #86

Open
springionic opened this issue Jul 12, 2022 · 0 comments
Open

go version 1.18 Generics, swag init failed #86

springionic opened this issue Jul 12, 2022 · 0 comments

Comments

@springionic
Copy link

When I use go 1.18 new feature: generics, I get error: expected '(', found '[' (and 1 more errors).
Obviously, swag parse not support go 1.18 new feature generics.
So when to support generics 馃樁

func IsElemInList[T any](elem T, list []T) bool {
	for i := 0; i < len(list); i++ {
		if reflect.DeepEqual(elem, list[i]) {
			return true
		}
	}
	return false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant