Skip to content
Draft
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 pubsub/schemas/commit_avro_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"os"

"cloud.google.com/go/pubsub"
)

// commitAvroSchema commits a new avro schema revision to an existing schema.
// commitAvroSchema commits a new Avro schema revision to an existing schema.
func commitAvroSchema(w io.Writer, projectID, schemaID, avscFile string) error {
// projectID := "my-project-id"
// schemaID := "my-schema-id"
Expand All @@ -37,7 +37,7 @@ func commitAvroSchema(w io.Writer, projectID, schemaID, avscFile string) error {
defer client.Close()

// Read an Avro schema file formatted in JSON as a byte slice.
avscSource, err := ioutil.ReadFile(avscFile)
avscSource, err := os.ReadFile(avscFile)
if err != nil {
return fmt.Errorf("error reading from file: %s", avscFile)
}
Expand Down
5 changes: 2 additions & 3 deletions storage/objects/download_file_into_memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"time"

"cloud.google.com/go/storage"
Expand All @@ -47,9 +46,9 @@ func downloadFileIntoMemory(w io.Writer, bucket, object string) ([]byte, error)
}
defer rc.Close()

data, err := ioutil.ReadAll(rc)
data, err := io.ReadAll(rc)
if err != nil {
return nil, fmt.Errorf("ioutil.ReadAll: %w", err)
return nil, fmt.Errorf("io.ReadAll: %w", err)
}
fmt.Fprintf(w, "Blob %v downloaded.\n", object)
return data, nil
Expand Down
Loading