Skip to content

Conversation

@david-littlefarmer
Copy link
Contributor

Breaking change: Added getters for method so it can be used with interfaces to fetch values with helper functions, without need to use reflect.

type method struct {
	name        string
	service     string
	annotations map[string]string
}

func (m method) Name() string {
	return m.name
}

func (m method) Service() string {
	return m.service
}

func (m method) Annotations() map[string]string {
	res := make(map[string]string, len(m.annotations))
	for k, v := range m.annotations {
		res[k] = v
	}

	return res
}

Added new line after in and out parameters, instead of one hardcoded new line, for better readability.

Before:

func (c *exampleServiceClient) Ping(ctx context.Context) error {

	resp, err := doHTTPRequest(ctx, c.client, c.urls[0], nil, nil)

After:

func (c *exampleServiceClient) Ping(ctx context.Context) error {
	resp, err := doHTTPRequest(ctx, c.client, c.urls[0], nil, nil)

Copy link
Contributor

@VojtechVitek VojtechVitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@VojtechVitek VojtechVitek merged commit 3ef0300 into master Apr 24, 2025
1 check passed
@VojtechVitek VojtechVitek deleted the methods_getters branch April 24, 2025 12:26
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

Successfully merging this pull request may close these issues.

3 participants