pre-commit-golang
pre-commit-golang copied to clipboard
support generics
latest version gives error expected '(', found '[' for generics.
The syntax -
func bootThirdPartyClient[T any](address string, isNewRelicEnabled bool, fn func(cc grpc.ClientConnInterface) T) (T, error) { client := grpcclient.New(isNewRelicEnabled) if err := client.Connect(address, log); err != nil { var tmp T return tmp, fmt.Errorf("grpcclient.New(): %w", err) } return fn(client.ClientConn), nil }
Hello, thank you for the bug report! Unfortunately I am not maintaining this repo anymore. See #98.
Maybe one of the other golang pre-commit hooks have this support.