Skip to content

Commit

Permalink
chore: Replace deprecated 'ioutil'
Browse files Browse the repository at this point in the history
  • Loading branch information
ja-he committed Nov 8, 2023
1 parent 8beae1f commit e9412b4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions internal/control/cli/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cli

import (
"fmt"
"io/ioutil"
"os"
"strings"

Expand Down Expand Up @@ -40,7 +39,7 @@ func (command *AddCommand) Execute(args []string) error {
}

// read config from file (for the category priorities)
yamlData, err := ioutil.ReadFile(envData.BaseDirPath + "/" + "config.yaml")
yamlData, err := os.ReadFile(envData.BaseDirPath + "/" + "config.yaml")
if err != nil {
panic(fmt.Sprintf("ERROR: can't read config file: '%s'", err))
}
Expand Down
3 changes: 1 addition & 2 deletions internal/control/cli/summarize.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cli

import (
"fmt"
"io/ioutil"
"log"
"os"
"strings"
Expand Down Expand Up @@ -43,7 +42,7 @@ func (command *SummarizeCommand) Execute(args []string) error {
}

// read config from file (for the category priorities)
yamlData, err := ioutil.ReadFile(envData.BaseDirPath + "/" + "config.yaml")
yamlData, err := os.ReadFile(envData.BaseDirPath + "/" + "config.yaml")
if err != nil {
panic(fmt.Sprintf("can't read config file: '%s'", err))
}
Expand Down
3 changes: 1 addition & 2 deletions internal/control/cli/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cli

import (
"io"
"io/ioutil"
"os"
"strings"
"time"
Expand Down Expand Up @@ -90,7 +89,7 @@ func (command *TuiCommand) Execute(args []string) error {
envData.Longitude = os.Getenv("LONGITUDE")

// read config from file
yamlData, err := ioutil.ReadFile(envData.BaseDirPath + "/" + "config.yaml")
yamlData, err := os.ReadFile(envData.BaseDirPath + "/" + "config.yaml")
if err != nil {
log.Warn().Err(err).Msg("can't read config file: '%s', using defaults")
yamlData = make([]byte, 0)
Expand Down

0 comments on commit e9412b4

Please sign in to comment.