Skip to content

Commit

Permalink
fix:staticcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
asabya committed Aug 29, 2023
1 parent 9ba0bb8 commit da9e36e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions internal/screens/loginView.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"

Expand Down Expand Up @@ -41,7 +40,7 @@ type userRequest struct {

func (i *index) initLoginView() fyne.CanvasObject {
// load config
data, err := ioutil.ReadFile(filepath.Join(i.app.Storage().RootURI().Path(), config))
data, err := os.ReadFile(filepath.Join(i.app.Storage().RootURI().Path(), config))
if err != nil {
if os.IsNotExist(err) {
return i.initConfigView(false)
Expand Down Expand Up @@ -360,7 +359,7 @@ func (i *index) initConfigView(allowBack bool) fyne.CanvasObject {
dialog.NewError(fmt.Errorf("config write failed : %s", err.Error()), i.Window).Show()
return
}
err = ioutil.WriteFile(filepath.Join(i.app.Storage().RootURI().Path(), config), configBytes, 0700)
err = os.WriteFile(filepath.Join(i.app.Storage().RootURI().Path(), config), configBytes, 0700)
if err != nil {
dialog.NewError(fmt.Errorf("config write failed : %s", err.Error()), i.Window).Show()
return
Expand Down
2 changes: 1 addition & 1 deletion internal/screens/notesView.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func newNotesListView(mainView *mainView, forceReload bool) *notesListView {
if cachedNotes == nil {
forceReload = true
}
if cachedNotes == nil {
if forceReload {
items := []*note{}
list, err := mainView.index.dfsAPI.DocFind(mainView.index.sessionID, utils.PodName, utils.NotesTable, "id>0", 100)
if err == nil {
Expand Down

0 comments on commit da9e36e

Please sign in to comment.