pre-commit-golang icon indicating copy to clipboard operation
pre-commit-golang copied to clipboard

support generics

Open KaungMyatChanThar opened this issue 1 year ago • 1 comments

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 }

KaungMyatChanThar avatar Jan 29 '24 04:01 KaungMyatChanThar

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.

dnephin avatar Mar 01 '24 04:03 dnephin