Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

support generics #108

@KaungMyatChanThar

Description

@KaungMyatChanThar

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 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions