diff --git a/pubsub/schemas/commit_avro_schema.go b/pubsub/schemas/commit_avro_schema.go index bf19df0b0e..b2aea4b982 100644 --- a/pubsub/schemas/commit_avro_schema.go +++ b/pubsub/schemas/commit_avro_schema.go @@ -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" @@ -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) } diff --git a/storage/objects/download_file_into_memory.go b/storage/objects/download_file_into_memory.go index 632b672884..41e50fcaec 100644 --- a/storage/objects/download_file_into_memory.go +++ b/storage/objects/download_file_into_memory.go @@ -21,7 +21,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "time" "cloud.google.com/go/storage" @@ -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