Skip to content

Commit 1386a7b

Browse files
committed
Removed now useless local variable
1 parent 39387df commit 1386a7b

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

main.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,6 @@ func loop() {
188188
log.SetLevel(log.InfoLevel)
189189
log.SetOutput(os.Stdout)
190190

191-
// the important folders of the agent
192-
src, _ := os.Executable()
193-
srcPath := paths.New(src) // The path of the agent's binary
194-
srcDir := srcPath.Parent() // The directory of the agent's binary
195-
196191
// Instantiate Tools
197192
Tools = tools.Tools{
198193
Directory: getDataDir().String(),
@@ -221,8 +216,9 @@ func loop() {
221216
configPath = defaultConfigPath
222217
log.Infof("using config from default: %s", configPath)
223218
} else {
224-
// take the config from the old folder where the agent's binary sits
225-
oldConfigPath := srcDir.Join("config.ini")
219+
// Fall back to the old config.ini location
220+
src, _ := os.Executable()
221+
oldConfigPath := paths.New(src).Parent().Join("config.ini")
226222
if oldConfigPath.Exist() {
227223
err := oldConfigPath.CopyTo(defaultConfigPath)
228224
if err != nil {

0 commit comments

Comments
 (0)