mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 06:30:52 +00:00
Merge pull request #2581 from guohuang/bug
Removed local variable declaration in Go
This commit is contained in:
commit
668dccfbcf
@ -21,16 +21,13 @@ type Configuration struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewConfiguration() *Configuration {
|
func NewConfiguration() *Configuration {
|
||||||
defaultHeader := make(map[string]string)
|
|
||||||
apiKey := make(map[string]string)
|
|
||||||
apiKeyPrefix := make(map[string]string)
|
|
||||||
return &Configuration{
|
return &Configuration{
|
||||||
BasePath: "{{basePath}}",
|
BasePath: "{{basePath}}",
|
||||||
UserName: "",
|
UserName: "",
|
||||||
Debug: false,
|
Debug: false,
|
||||||
DefaultHeader: defaultHeader,
|
DefaultHeader: make(map[string]string),
|
||||||
ApiKey: apiKey,
|
ApiKey: make(map[string]string),
|
||||||
ApiKeyPrefix: apiKeyPrefix,
|
ApiKeyPrefix: make(map[string]string) ,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,11 +40,9 @@ func (c *Configuration) AddDefaultHeader(key string, value string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Configuration) GetApiKeyWithPrefix(apiKeyIdentifier string) string {
|
func (c *Configuration) GetApiKeyWithPrefix(apiKeyIdentifier string) string {
|
||||||
var returnValue = c.ApiKey[apiKeyIdentifier]
|
if c.ApiKeyPrefix[apiKeyIdentifier] != ""{
|
||||||
var apiKeyPrefix = c.ApiKeyPrefix[apiKeyIdentifier]
|
return c.ApiKeyPrefix[apiKeyIdentifier] + " " + c.ApiKey[apiKeyIdentifier]
|
||||||
if apiKeyPrefix != ""{
|
|
||||||
returnValue = apiKeyPrefix + " " + returnValue
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnValue
|
return c.ApiKey[apiKeyIdentifier]
|
||||||
}
|
}
|
@ -21,16 +21,13 @@ type Configuration struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewConfiguration() *Configuration {
|
func NewConfiguration() *Configuration {
|
||||||
defaultHeader := make(map[string]string)
|
|
||||||
apiKey := make(map[string]string)
|
|
||||||
apiKeyPrefix := make(map[string]string)
|
|
||||||
return &Configuration{
|
return &Configuration{
|
||||||
BasePath: "http://petstore.swagger.io/v2",
|
BasePath: "http://petstore.swagger.io/v2",
|
||||||
UserName: "",
|
UserName: "",
|
||||||
Debug: false,
|
Debug: false,
|
||||||
DefaultHeader: defaultHeader,
|
DefaultHeader: make(map[string]string),
|
||||||
ApiKey: apiKey,
|
ApiKey: make(map[string]string),
|
||||||
ApiKeyPrefix: apiKeyPrefix,
|
ApiKeyPrefix: make(map[string]string) ,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,11 +40,9 @@ func (c *Configuration) AddDefaultHeader(key string, value string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Configuration) GetApiKeyWithPrefix(apiKeyIdentifier string) string {
|
func (c *Configuration) GetApiKeyWithPrefix(apiKeyIdentifier string) string {
|
||||||
var returnValue = c.ApiKey[apiKeyIdentifier]
|
if c.ApiKeyPrefix[apiKeyIdentifier] != ""{
|
||||||
var apiKeyPrefix = c.ApiKeyPrefix[apiKeyIdentifier]
|
return c.ApiKeyPrefix[apiKeyIdentifier] + " " + c.ApiKey[apiKeyIdentifier]
|
||||||
if apiKeyPrefix != ""{
|
|
||||||
returnValue = apiKeyPrefix + " " + returnValue
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnValue
|
return c.ApiKey[apiKeyIdentifier]
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user