Skip to content

Commit 2d77f7b

Browse files
committed
rename variables
1 parent f004487 commit 2d77f7b

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

cmd/src/main.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,14 @@ func (c *config) apiClient(flags *api.Flags, out io.Writer) api.Client {
163163

164164
// readConfig reads the config file from the given path.
165165
func readConfig() (*config, error) {
166-
cfgFilePath := *configPath
166+
cfgFile := *configPath
167167
userSpecified := *configPath != ""
168168

169169
if !userSpecified {
170-
cfgFilePath = "~/src-config.json"
170+
cfgFile = "~/src-config.json"
171171
}
172172

173-
cfgPath, err := expandHomeDir(cfgFilePath)
173+
cfgPath, err := expandHomeDir(cfgFile)
174174
if err != nil {
175175
return nil, err
176176
}
@@ -179,7 +179,7 @@ func readConfig() (*config, error) {
179179
if err != nil && (!os.IsNotExist(err) || userSpecified) {
180180
return nil, err
181181
}
182-
var cfgFile struct {
182+
var configFromFile struct {
183183
Endpoint string `json:"endpoint"`
184184
AccessToken string `json:"accessToken"`
185185
AdditionalHeaders map[string]string `json:"additionalHeaders"`
@@ -190,13 +190,13 @@ func readConfig() (*config, error) {
190190
var proxyStr string
191191
if err == nil {
192192
cfg.configFilePath = cfgPath
193-
if err := json.Unmarshal(data, &cfgFile); err != nil {
193+
if err := json.Unmarshal(data, &configFromFile); err != nil {
194194
return nil, err
195195
}
196-
endpointStr = cfgFile.Endpoint
197-
cfg.accessToken = cfgFile.AccessToken
198-
cfg.additionalHeaders = cfgFile.AdditionalHeaders
199-
proxyStr = cfgFile.Proxy
196+
endpointStr = configFromFile.Endpoint
197+
cfg.accessToken = configFromFile.AccessToken
198+
cfg.additionalHeaders = configFromFile.AdditionalHeaders
199+
proxyStr = configFromFile.Proxy
200200
}
201201

202202
envToken := os.Getenv("SRC_ACCESS_TOKEN")

0 commit comments

Comments
 (0)