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

Replace io/ioutils as it is deprecated #45

Merged
merged 1 commit into from
May 16, 2024
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 cmd/datasetIngestor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
Expand Down Expand Up @@ -216,7 +215,7 @@ func main() {
folders = append(folders, sourceFolder)
} else {
// get folders from file
folderlist, err := ioutil.ReadFile(folderlistingPath)
folderlist, err := os.ReadFile(folderlistingPath)
if err != nil {
log.Fatal(err)
}
Expand Down
6 changes: 3 additions & 3 deletions datasetIngestor/checkMetadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"encoding/json"
"github.com/paulscherrerinstitute/scicat/datasetUtils"
"io/ioutil"
"io"
"log"
"net"
"net/http"
Expand Down Expand Up @@ -61,7 +61,7 @@ func CheckMetadata(client *http.Client, APIServer string, metadatafile string, u

// readMetadataFromFile reads the metadata from the file and unmarshals it into a map.
func readMetadataFromFile(metadatafile string) (map[string]interface{}, error) {
b, err := ioutil.ReadFile(metadatafile) // just pass the file name
b, err := os.ReadFile(metadatafile) // just pass the file name
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -330,7 +330,7 @@ func checkMetadataValidity(client *http.Client, APIServer string, metaDataMap ma
return fmt.Errorf("unexpected status code: %d", resp.StatusCode)
}

_, err = ioutil.ReadAll(resp.Body)
_, err = io.ReadAll(resp.Body)
if err != nil {
return err
}
Expand Down
Loading