mirror of
https://github.com/jkaninda/go-storage.git
synced 2025-12-07 00:59:39 +01:00
refactor: refactoring of code to meet all go lint requirements
This commit is contained in:
@@ -45,7 +45,12 @@ func createFile(fileName, content string) ([]byte, error) {
|
||||
fmt.Println("Error creating file:", err)
|
||||
return nil, err
|
||||
}
|
||||
defer file.Close()
|
||||
defer func(file *os.File) {
|
||||
err := file.Close()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}(file)
|
||||
|
||||
// Write the message to the file
|
||||
_, err = file.WriteString(content)
|
||||
|
||||
Reference in New Issue
Block a user