Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint errors for using deprecated functionality #35

Merged
merged 1 commit into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmd/sync/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"log"
"net/http"
"net/url"
Expand All @@ -28,7 +28,7 @@ func githubGetPAT(ctx context.Context) (string, error) {
if err != nil {
return "", err
}
raw, err := ioutil.ReadAll(response.Body)
raw, err := io.ReadAll(response.Body)
if err != nil {
return "", err
}
Expand Down Expand Up @@ -58,7 +58,7 @@ func githubGetPAT(ctx context.Context) (string, error) {
if err != nil {
return retries.Halt(err)
}
raw, err := ioutil.ReadAll(response.Body)
raw, err := io.ReadAll(response.Body)
if err != nil {
return retries.Continuef("failed to read body: %w", err)
}
Expand Down Expand Up @@ -100,7 +100,7 @@ func githubGetPAT(ctx context.Context) (string, error) {
if err != nil {
return "", err
}
raw, _ = ioutil.ReadAll(response.Body)
raw, _ = io.ReadAll(response.Body)
log.Printf("[INFO] %s", raw)
// TODO: convert to PAT
return bearer, nil
Expand Down
3 changes: 1 addition & 2 deletions git/fileset.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package git
import (
"fmt"
"io/fs"
"io/ioutil"
"os"
"path"
"strings"
Expand Down Expand Up @@ -45,7 +44,7 @@ func MustGetFileSet() FileSet {

func New(root string) FileSet {
lines := []string{".git"}
rawIgnore, err := ioutil.ReadFile(fmt.Sprintf("%s/.gitignore", root))
rawIgnore, err := os.ReadFile(fmt.Sprintf("%s/.gitignore", root))
if err == nil {
// add entries from .gitignore if the file exists (did read correctly)
for _, line := range strings.Split(string(rawIgnore), "\n") {
Expand Down
4 changes: 2 additions & 2 deletions project/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package project

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

Expand Down Expand Up @@ -83,7 +83,7 @@ func loadProjectConf() (prj Project, err error) {
if err != nil {
return
}
raw, err := ioutil.ReadAll(config)
raw, err := io.ReadAll(config)
if err != nil {
return
}
Expand Down