Skip to content

Commit

Permalink
Merge pull request #42 from nwg-piotr/fix41
Browse files Browse the repository at this point in the history
Fix #41
  • Loading branch information
nwg-piotr authored Jul 25, 2023
2 parents 4650205 + f1619cc commit f0f9f72
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Piotr Miller
Copyright (c) 2022-2023 Piotr Miller & Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/gotk3/gotk3/gtk"
)

const version = "0.2.3"
const version = "0.2.4"

var (
preferences programSettings
Expand Down
10 changes: 4 additions & 6 deletions tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/fs"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -1078,7 +1076,7 @@ func iconThemeName(path string) (string, bool, error) {
}

func loadTextFile(path string) ([]string, error) {
bytes, err := ioutil.ReadFile(path)
bytes, err := os.ReadFile(path)
if err != nil {
return nil, err
}
Expand All @@ -1094,7 +1092,7 @@ func loadTextFile(path string) ([]string, error) {
func saveTextFile(text []string, path string) {
file, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)
if err != nil {
log.Fatalf("Failed creating file: %s", err)
log.Warnf("Failed creating file: %s", err)
}
datawriter := bufio.NewWriter(file)

Expand All @@ -1106,8 +1104,8 @@ func saveTextFile(text []string, path string) {
file.Close()
}

func listFiles(dir string) ([]fs.FileInfo, error) {
files, err := ioutil.ReadDir(dir)
func listFiles(dir string) ([]os.DirEntry, error) {
files, err := os.ReadDir(dir)
if err == nil {
return files, nil
}
Expand Down

0 comments on commit f0f9f72

Please sign in to comment.