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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go snippets result variable inconsistent with other languages. #1114

Closed
jasonjoh opened this issue Jul 29, 2022 · 2 comments · Fixed by #1669
Closed

Go snippets result variable inconsistent with other languages. #1114

jasonjoh opened this issue Jul 29, 2022 · 2 comments · Fixed by #1669
Assignees
Labels
area: go Issues that related to Go snippets generation area: snippets-generation Describes a required fix to the snippet generator type: enhancement Enhancement request targeting an existing experience

Comments

@jasonjoh
Copy link
Member

Describe the bug
C#, Java, and JavaScript all define a result variable that has a name derived from the type. For example, the request in Graph Explorer:

GET https://graph.microsoft.com/v1.0/groups

Will result in a snippet like this in C#:

var groups = await graphClient.Groups
	.Request()
	.GetAsync();

But in Go, it just uses a generic result.

result, err := graphClient.Groups().Get()

To Reproduce
Look at the snippets on Graph Explorer for any GET request.

Expected behavior
Go snippets should be consistent with the other languages. I'd expect something like

groups, err := graphClient.Groups().Get()
@jasonjoh jasonjoh added area: snippets-generation Describes a required fix to the snippet generator area: go Issues that related to Go snippets generation labels Jul 29, 2022
@rkodev
Copy link
Contributor

rkodev commented Apr 12, 2023

@ddyett @jasonjoh It looks like all the other languages have now adopted the name result for the variable, can we close this ticket?

@jasonjoh
Copy link
Member Author

I see C# has move to this, but Java and JavaScript still use the more descriptive name for the result variable.

IMO, we should use a more descriptive name and avoid the generic result.

@millicentachieng millicentachieng added the type: enhancement Enhancement request targeting an existing experience label Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: go Issues that related to Go snippets generation area: snippets-generation Describes a required fix to the snippet generator type: enhancement Enhancement request targeting an existing experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants