mirror of
https://codeberg.org/scip/anydb.git
synced 2026-10-08 11:14:20 +02:00
update linter config, satisfy linter (#28)
This commit is contained in:
16
app/io.go
16
app/io.go
@@ -1,3 +1,5 @@
|
||||
package app
|
||||
|
||||
/*
|
||||
Copyright © 2024 Thomas von Dein
|
||||
|
||||
@@ -14,18 +16,24 @@ GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package app
|
||||
|
||||
import "os"
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
)
|
||||
|
||||
func cleanError(file string, err error) error {
|
||||
// remove given [backup] file and forward the given error
|
||||
return os.Remove(file)
|
||||
oserr := os.Remove(file)
|
||||
if oserr != nil {
|
||||
return errors.Join(err, oserr)
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func fileExists(filename string) bool {
|
||||
info, err := os.Stat(filename)
|
||||
|
||||
if err != nil {
|
||||
// return false on any error
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user