Skip to content

Commit

Permalink
check if the ini file can be found, else error
Browse files Browse the repository at this point in the history
  • Loading branch information
QuintenQVD0 committed Jan 30, 2024
1 parent 4587346 commit 6eed510
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ func main() {
return
}

// Check if the INI file exists
if _, err := os.Stat(iniFilePath); os.IsNotExist(err) {
fmt.Printf("INI file not found, Exiting")
return
}

// Read the contents of the original INI file
iniContent, err := ioutil.ReadFile(iniFilePath)
if err != nil {
Expand Down

0 comments on commit 6eed510

Please sign in to comment.