Skip to content

Commit 7d4794b

Browse files
committed
ignore main in ini
1 parent c774ab7 commit 7d4794b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

main.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ func main() {
116116

117117
// Parse ini config
118118
args, err := parseIni("config.ini")
119-
fmt.Println(args)
120119
if err != nil {
121120
panic(err)
122121
}
@@ -130,7 +129,10 @@ func main() {
130129
if err != nil {
131130
panic(err)
132131
}
133-
iniConf.Parse(args)
132+
err = iniConf.Parse(args)
133+
if err != nil {
134+
panic(err)
135+
}
134136

135137
// Instantiate Tools
136138
usr, _ := user.Current()
@@ -454,7 +456,6 @@ body {
454456

455457
func parseIni(filename string) (args []string, err error) {
456458
cfg, err := ini.LoadSources(ini.LoadOptions{IgnoreInlineComment: false}, filename)
457-
458459
if err != nil {
459460
return nil, err
460461
}
@@ -467,6 +468,9 @@ func parseIni(filename string) (args []string, err error) {
467468
} // Ignore configUpdateInterval
468469
if key == "configUpdateInterval" {
469470
continue
471+
} // Ignore name
472+
if key == "name" {
473+
continue
470474
}
471475
args = append(args, "-"+key, val)
472476
}

0 commit comments

Comments
 (0)