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

Swap io/ioutil package for io package #136

Merged
merged 1 commit into from
Aug 24, 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
6 changes: 3 additions & 3 deletions internal/lockss/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
package lockss

import (
"io/ioutil"
"io"
"log"
"os"
)
Expand All @@ -24,7 +24,7 @@ func init() {
// Disable logging output by default unless client code explicitly
// requests it
logger = log.New(os.Stderr, "[go-lockss/lockss] ", 0)
logger.SetOutput(ioutil.Discard)
logger.SetOutput(io.Discard)

}

Expand All @@ -39,5 +39,5 @@ func EnableLogging() {
// all logging output.
func DisableLogging() {
logger.SetFlags(0)
logger.SetOutput(ioutil.Discard)
logger.SetOutput(io.Discard)
}
4 changes: 2 additions & 2 deletions internal/lockss/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"context"
"errors"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -185,7 +185,7 @@ func (c *Config) loadFromPropsURLWithContext(ctx context.Context, url string) (*

// Get the response body directly. We'll create a bytes buffer later to
// wrap the response data in order to provide an io.Reader where needed.
responseData, err := ioutil.ReadAll(resp.Body)
responseData, err := io.ReadAll(resp.Body)
if err != nil {
logger.Println(err)
return nil, err
Expand Down