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] Fixing compilation issue when pathParams is not presented #3543

Merged
merged 2 commits into from
Aug 6, 2016

Conversation

guohuang
Copy link
Contributor

@guohuang guohuang commented Aug 5, 2016

@wing328 please review, this is solving the pathParams empty issue

// this will only import "strings" "fmt" if there are items in pathParams
for (CodegenOperation operation : operations) {
if(operation.pathParams != null && operation.pathParams.size() > 0) {
imports.add(createMapping("import", "fmt"));
Copy link
Contributor

Choose a reason for hiding this comment

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

What a good idea!

Copy link
Contributor

Choose a reason for hiding this comment

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

The postProcessOperations and postProcessModels are pretty useful in meeting language-specified requirement.

@wing328
Copy link
Contributor

wing328 commented Aug 6, 2016

CI reported failure running Go tests:

# _/home/travis/build/swagger-api/swagger-codegen/samples/client/petstore/go/go-petstore
go-petstore/pet_api.go:26: imported and not used: "errors"
go-petstore/store_api.go:26: imported and not used: "errors"
go-petstore/user_api.go:26: imported and not used: "errors"
FAIL    _/home/travis/build/swagger-api/swagger-codegen/samples/client/petstore/go [build failed]

Please take a look when you've time.

@wing328 wing328 added this to the v2.2.1 milestone Aug 6, 2016
@guohuang
Copy link
Contributor Author

guohuang commented Aug 6, 2016

@wing328 sorry, I accidentally added the "errors" reference, it is fixed now

@wing328
Copy link
Contributor

wing328 commented Aug 6, 2016

@guohuang no worry. The CI caught it :)

I'll merge it shortly. Have a nice weekend.

@wing328 wing328 merged commit e8095c6 into swagger-api:master Aug 6, 2016
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