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] Fix go client formatting #7283

Merged
merged 14 commits into from
Jan 7, 2018
Merged

[go] Fix go client formatting #7283

merged 14 commits into from
Jan 7, 2018

Conversation

alex-slynko
Copy link
Contributor

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: 3.0.0 branch for changes related to OpenAPI spec 3.0. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.
    @antihax

Description of the PR

This PR goes one step further from #3518. Often, goimports is used as a formatting standard. I converted library to produce code that satisfies goimports.

Missing things:

  • import sorting for API. All imports has to be places into AbstractGoCodegen
  • whitespaces for some descriptions. Go does not like trailing whitespaces

bvwells and others added 14 commits December 20, 2017 21:10
Before secret feature was used to add new line using two property
declaration in the same line. There should be no new line before
first property. The easiest way is to use `-first` special
property
https://github.com/samskivert/jmustache#-first-and--last

New line are required so `goimports` won't reformat  whitespaces between
property name and type.
There is a new line between each service to prevent `goimports` from
adding whitespaces between types and names
There was a need to set special delimeter for formatting in the commit.
Go slices use curly braces and `jmustache` got confused when found
triple curly braces.
Do not add whitespace if description is missing
- imports are not sorted :(
- there are extra whitespaces for different languages. I don't know why
@wing328 wing328 added this to the v2.4.0 milestone Jan 7, 2018
@wing328 wing328 changed the base branch from master to 2.4.0 January 7, 2018 03:16
@wing328 wing328 merged commit 919f867 into swagger-api:2.4.0 Jan 7, 2018
@wing328
Copy link
Contributor

wing328 commented Jan 7, 2018

@alex-slynko thanks for the PR, which has been merged into 2.4.0.

cc @bvwells

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants