fix linting errors

This commit is contained in:
2025-11-26 20:40:35 +01:00
parent dafcaad0ef
commit 718f30578d
3 changed files with 9 additions and 14 deletions

View File

@@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package main
import (
"errors"
"fmt"
"os"
"path/filepath"
@@ -81,7 +82,7 @@ func InitConfig() (*Config, error) {
// setup custom usage
flagset := flag.NewFlagSet("config", flag.ContinueOnError)
flagset.Usage = func() {
fmt.Println(Usage)
_, _ = fmt.Println(Usage)
os.Exit(0)
}
@@ -165,13 +166,13 @@ func SanitiyCheck(conf *Config) error {
geo := strings.Split(conf.Geo, "x")
if len(geo) != 2 {
return fmt.Errorf(geoerr)
return errors.New(geoerr)
}
w, errw := strconv.Atoi(geo[0])
h, errh := strconv.Atoi(geo[1])
if errw != nil || errh != nil {
return fmt.Errorf(geoerr)
return errors.New(geoerr)
}
conf.Width = w
@@ -195,11 +196,3 @@ func SanitiyCheck(conf *Config) error {
return nil
}
func fileExists(filename string) bool {
info, err := os.Stat(filename)
if os.IsNotExist(err) {
return false
}
return !info.IsDir()
}