mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 02:55:19 +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 {
|
||||
defaultHeader := make(map[string]string)
|
||||
apiKey := make(map[string]string)
|
||||
apiKeyPrefix := make(map[string]string)
|
||||
return &Configuration{
|
||||
BasePath: "{{basePath}}",
|
||||
UserName: "",
|
||||
Debug: false,
|
||||
DefaultHeader: defaultHeader,
|
||||
ApiKey: apiKey,
|
||||
ApiKeyPrefix: apiKeyPrefix,
|
||||
DefaultHeader: make(map[string]string),
|
||||
ApiKey: make(map[string]string),
|
||||
ApiKeyPrefix: make(map[string]string) ,
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,11 +40,9 @@ func (c *Configuration) AddDefaultHeader(key string, value string) {
|
||||
}
|
||||
|
||||
func (c *Configuration) GetApiKeyWithPrefix(apiKeyIdentifier string) string {
|
||||
var returnValue = c.ApiKey[apiKeyIdentifier]
|
||||
var apiKeyPrefix = c.ApiKeyPrefix[apiKeyIdentifier]
|
||||
if apiKeyPrefix != ""{
|
||||
returnValue = apiKeyPrefix + " " + returnValue
|
||||
if c.ApiKeyPrefix[apiKeyIdentifier] != ""{
|
||||
return c.ApiKeyPrefix[apiKeyIdentifier] + " " + c.ApiKey[apiKeyIdentifier]
|
||||
}
|
||||
|
||||
return returnValue
|
||||
return c.ApiKey[apiKeyIdentifier]
|
||||
}
|
@ -21,16 +21,13 @@ type Configuration struct {
|
||||
}
|
||||
|
||||
func NewConfiguration() *Configuration {
|
||||
defaultHeader := make(map[string]string)
|
||||
apiKey := make(map[string]string)
|
||||
apiKeyPrefix := make(map[string]string)
|
||||
return &Configuration{
|
||||
BasePath: "http://petstore.swagger.io/v2",
|
||||
UserName: "",
|
||||
Debug: false,
|
||||
DefaultHeader: defaultHeader,
|
||||
ApiKey: apiKey,
|
||||
ApiKeyPrefix: apiKeyPrefix,
|
||||
DefaultHeader: make(map[string]string),
|
||||
ApiKey: make(map[string]string),
|
||||
ApiKeyPrefix: make(map[string]string) ,
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,11 +40,9 @@ func (c *Configuration) AddDefaultHeader(key string, value string) {
|
||||
}
|
||||
|
||||
func (c *Configuration) GetApiKeyWithPrefix(apiKeyIdentifier string) string {
|
||||
var returnValue = c.ApiKey[apiKeyIdentifier]
|
||||
var apiKeyPrefix = c.ApiKeyPrefix[apiKeyIdentifier]
|
||||
if apiKeyPrefix != ""{
|
||||
returnValue = apiKeyPrefix + " " + returnValue
|
||||
if c.ApiKeyPrefix[apiKeyIdentifier] != ""{
|
||||
return c.ApiKeyPrefix[apiKeyIdentifier] + " " + c.ApiKey[apiKeyIdentifier]
|
||||
}
|
||||
|
||||
return returnValue
|
||||
return c.ApiKey[apiKeyIdentifier]
|
||||
}
|
Loading…
Reference in New Issue
Block a user