这是indexloc提供的服务,不要输入任何密码
Skip to content
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
3 changes: 1 addition & 2 deletions config/config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package config

import (
"io/ioutil"
"net/url"
"path"
"strings"
Expand Down Expand Up @@ -118,7 +117,7 @@ func (c *Config) SetAPIToken(token string) {

// SetAPITokenFromFile accepts a file containing an oauth2 token for usage in http.request
func (c *Config) SetAPITokenFromFile(tokenFile string) error {
b, err := ioutil.ReadFile(tokenFile)
b, err := os.ReadFile(tokenFile)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions exporter/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package exporter

import (
"fmt"
"io/ioutil"
"io"
"net/http"
neturl "net/url"
"strconv"
Expand Down Expand Up @@ -111,7 +111,7 @@ func getResponse(url string, token string, ch chan<- *Response) error {
defer resp.Body.Close()

// Read the body to a byte array so it can be used elsewhere
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return fmt.Errorf("Error converting body to byte array: %v", err)
}
Expand Down
6 changes: 3 additions & 3 deletions test/github_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package test

import (
"fmt"
"io/ioutil"
"io"
"net/http"
"os"
"strings"
Expand Down Expand Up @@ -145,7 +145,7 @@ func githubPullsError() *apitest.Mock {
}

func readFile(path string) string {
bytes, err := ioutil.ReadFile(path)
bytes, err := os.ReadFile(path)
if err != nil {
panic(err)
}
Expand All @@ -154,7 +154,7 @@ func readFile(path string) string {

func bodyContains(substr string) func(*http.Response, *http.Request) error {
return func(res *http.Response, req *http.Request) error {
bytes, err := ioutil.ReadAll(res.Body)
bytes, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
Expand Down