-
Notifications
You must be signed in to change notification settings - Fork 11
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
Generate Go code samples #369
Conversation
@razor-x There was a typo in the setup-go action which caused the generation workflow to fail. I've pushed a fix for it. Also, while testing our samples with gofmt, I discovered several bugs in the way we generate the Go code samples. I've fixed these issues in this PR. Once it's merged and blueprint is updated here, the Go formatting should work correctly. |
docs/api/acs/systems/list.md
Outdated
import systems "github.com/seamapi/go/systems" | ||
|
||
func main() { | ||
client.Acs.Systems.List(context.Background(), systems.SystemsListRequest{ConnectedAccountId: api.String("123e4567-e89b-12d3-a456-426614174000")}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrii-balitskyi I was hoping gomft would break this long line. I wonder if we can force it to work if we add newlines after each argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I tested locally and it still doesn't seem to work with additional newlines:
func main() {
client.Acs.Systems.List(
context.Background(),
systems.SystemsListRequest{
ConnectedAccountId: api.String("123e4567-e89b-12d3-a456-426614174000")})
}
For example, the closing parenthesis of the List
method and the closing curly brace of SystemsListRequest
look off. However, it seems that's how gofmt works. If these closing characters were on a new line, gofmt would align them with their opening counterparts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, with changes in this PR the final formatting looks good
func main() {
client.Acs.Systems.List(
context.Background(),
systems.SystemsListRequest{
ConnectedAccountId: api.String("123e4567-e89b-12d3-a456-426614174000"),
},
)
}
No description provided.