From c702a6aaa498f3e408a8fa0c014fc437f7d2b19d Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 14 Apr 2016 15:15:19 +0800 Subject: [PATCH] regenerate go sample, rename configuration.go --- .../codegen/languages/GoClientCodegen.java | 2 +- .../go/{petApi_test.go => pet_api_test.go} | 0 .../go/swagger/{Category.go => category.go} | 0 .../{Configuration.go => configuration.go} | 0 .../go/swagger/{Order.go => order.go} | 0 .../petstore/go/swagger/{Pet.go => pet.go} | 0 samples/client/petstore/go/swagger/pet_api.go | 20 +++++++++---------- .../petstore/go/swagger/{Tag.go => tag.go} | 0 .../petstore/go/swagger/{User.go => user.go} | 0 .../client/petstore/go/swagger/user_api.go | 6 +++--- 10 files changed, 14 insertions(+), 14 deletions(-) rename samples/client/petstore/go/{petApi_test.go => pet_api_test.go} (100%) rename samples/client/petstore/go/swagger/{Category.go => category.go} (100%) rename samples/client/petstore/go/swagger/{Configuration.go => configuration.go} (100%) rename samples/client/petstore/go/swagger/{Order.go => order.go} (100%) rename samples/client/petstore/go/swagger/{Pet.go => pet.go} (100%) rename samples/client/petstore/go/swagger/{Tag.go => tag.go} (100%) rename samples/client/petstore/go/swagger/{User.go => user.go} (100%) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java index a42bb7f118c..5bebf932851 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoClientCodegen.java @@ -133,7 +133,7 @@ public class GoClientCodegen extends DefaultCodegen implements CodegenConfig { supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); - supportingFiles.add(new SupportingFile("configuration.mustache", packageName, "Configuration.go")); + supportingFiles.add(new SupportingFile("configuration.mustache", packageName, "configuration.go")); } @Override diff --git a/samples/client/petstore/go/petApi_test.go b/samples/client/petstore/go/pet_api_test.go similarity index 100% rename from samples/client/petstore/go/petApi_test.go rename to samples/client/petstore/go/pet_api_test.go diff --git a/samples/client/petstore/go/swagger/Category.go b/samples/client/petstore/go/swagger/category.go similarity index 100% rename from samples/client/petstore/go/swagger/Category.go rename to samples/client/petstore/go/swagger/category.go diff --git a/samples/client/petstore/go/swagger/Configuration.go b/samples/client/petstore/go/swagger/configuration.go similarity index 100% rename from samples/client/petstore/go/swagger/Configuration.go rename to samples/client/petstore/go/swagger/configuration.go diff --git a/samples/client/petstore/go/swagger/Order.go b/samples/client/petstore/go/swagger/order.go similarity index 100% rename from samples/client/petstore/go/swagger/Order.go rename to samples/client/petstore/go/swagger/order.go diff --git a/samples/client/petstore/go/swagger/Pet.go b/samples/client/petstore/go/swagger/pet.go similarity index 100% rename from samples/client/petstore/go/swagger/Pet.go rename to samples/client/petstore/go/swagger/pet.go diff --git a/samples/client/petstore/go/swagger/pet_api.go b/samples/client/petstore/go/swagger/pet_api.go index e7f2b25464f..2b73357eb06 100644 --- a/samples/client/petstore/go/swagger/pet_api.go +++ b/samples/client/petstore/go/swagger/pet_api.go @@ -201,9 +201,9 @@ func (a PetApi) FindPetsByStatus (status []string) ([]Pet, error) { } type QueryParams struct { - status []string `url:"status,omitempty"` + Status []string `url:"status,omitempty"` } - _sling = _sling.QueryStruct(&QueryParams{ status: status }) + _sling = _sling.QueryStruct(&QueryParams{ Status: status }) // accept header accepts := []string { "application/xml", "application/json" } for key := range accepts { @@ -274,9 +274,9 @@ func (a PetApi) FindPetsByTags (tags []string) ([]Pet, error) { } type QueryParams struct { - tags []string `url:"tags,omitempty"` + Tags []string `url:"tags,omitempty"` } - _sling = _sling.QueryStruct(&QueryParams{ tags: tags }) + _sling = _sling.QueryStruct(&QueryParams{ Tags: tags }) // accept header accepts := []string { "application/xml", "application/json" } for key := range accepts { @@ -497,10 +497,10 @@ func (a PetApi) UpdatePetWithForm (petId int64, name string, status string) (err } type FormParams struct { - name string `url:"name,omitempty"` - status string `url:"status,omitempty"` + Name string `url:"name,omitempty"` + Status string `url:"status,omitempty"` } - _sling = _sling.BodyForm(&FormParams{ name: name,status: status }) + _sling = _sling.BodyForm(&FormParams{ Name: name,Status: status }) @@ -574,10 +574,10 @@ func (a PetApi) UploadFile (petId int64, additionalMetadata string, file *os.Fil } type FormParams struct { - additionalMetadata string `url:"additionalMetadata,omitempty"` - file *os.File `url:"file,omitempty"` + AdditionalMetadata string `url:"additionalMetadata,omitempty"` + File *os.File `url:"file,omitempty"` } - _sling = _sling.BodyForm(&FormParams{ additionalMetadata: additionalMetadata,file: file }) + _sling = _sling.BodyForm(&FormParams{ AdditionalMetadata: additionalMetadata,File: file }) var successPayload = new(ApiResponse) diff --git a/samples/client/petstore/go/swagger/Tag.go b/samples/client/petstore/go/swagger/tag.go similarity index 100% rename from samples/client/petstore/go/swagger/Tag.go rename to samples/client/petstore/go/swagger/tag.go diff --git a/samples/client/petstore/go/swagger/User.go b/samples/client/petstore/go/swagger/user.go similarity index 100% rename from samples/client/petstore/go/swagger/User.go rename to samples/client/petstore/go/swagger/user.go diff --git a/samples/client/petstore/go/swagger/user_api.go b/samples/client/petstore/go/swagger/user_api.go index a6ed7c5d264..655e8b46fe9 100644 --- a/samples/client/petstore/go/swagger/user_api.go +++ b/samples/client/petstore/go/swagger/user_api.go @@ -374,10 +374,10 @@ func (a UserApi) LoginUser (username string, password string) (string, error) { } type QueryParams struct { - username string `url:"username,omitempty"` -password string `url:"password,omitempty"` + Username string `url:"username,omitempty"` +Password string `url:"password,omitempty"` } - _sling = _sling.QueryStruct(&QueryParams{ username: username,password: password }) + _sling = _sling.QueryStruct(&QueryParams{ Username: username,Password: password }) // accept header accepts := []string { "application/xml", "application/json" } for key := range accepts {