remove deprecated ioutil

This commit is contained in:
Rasmus Moorats 2024-05-30 11:58:50 +03:00
parent aa09649944
commit e9dee93982
Signed by: xx
GPG key ID: FE14255A6AE7241C

View file

@ -5,7 +5,7 @@ import (
"encoding/json"
"fmt"
"html"
"io/ioutil"
"io"
"net/http"
"os"
"strings"
@ -42,7 +42,7 @@ func load_toggl_api_key() (string, error) {
return "", err
}
key, err := ioutil.ReadFile(home + "/" + TOGGL_API_KEY_FILE)
key, err := os.ReadFile(home + "/" + TOGGL_API_KEY_FILE)
if err != nil {
return "", err
}
@ -109,7 +109,7 @@ func get_current_toggl_project() string {
return "toggl projectRequest error"
}
body, err = ioutil.ReadAll(resp.Body)
body, err = io.ReadAll(resp.Body)
if err != nil {
return "toggl projectRequest body error"
}