Skip to content

Commit

Permalink
Remove deprecated package - ioutil (#345)
Browse files Browse the repository at this point in the history
* remove deprecated pkg - ioutil

Signed-off-by: Gaurav Gahlot <gauravgahlot0107@gmail.com>

* remove deprecated pkg - ioutil

Signed-off-by: Gaurav Gahlot <gauravgahlot0107@gmail.com>

---------

Signed-off-by: Gaurav Gahlot <gauravgahlot0107@gmail.com>
  • Loading branch information
gauravgahlot authored Jun 17, 2024
1 parent b0c3811 commit c5e4afa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions go/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Copyright 2021 The Fission Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -16,7 +16,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"log"
"net/http"
"os"
Expand Down Expand Up @@ -63,7 +63,7 @@ func loadPlugin(codePath, entrypoint string) (http.HandlerFunc, error) {
return nil, fmt.Errorf("error checking plugin path: %v", err)
}
if info.IsDir() {
files, err := ioutil.ReadDir(codePath)
files, err := os.ReadDir(codePath)
if err != nil {
return nil, fmt.Errorf("error reading directory: %v", err)
}
Expand Down Expand Up @@ -163,7 +163,7 @@ func specializeHandlerV2() func(http.ResponseWriter, *http.Request) {
return
}

body, err := ioutil.ReadAll(r.Body)
body, err := io.ReadAll(r.Body)
if err != nil {
log.Printf("error reading request body: %v", err)
w.WriteHeader(http.StatusInternalServerError)
Expand Down
4 changes: 2 additions & 2 deletions tensorflow-serving/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"log"
"net"
"net/http"
Expand Down Expand Up @@ -66,7 +66,7 @@ func specializeHandlerV2(logger *zap.Logger) func(http.ResponseWriter, *http.Req
return
}

body, err := ioutil.ReadAll(r.Body)
body, err := io.ReadAll(r.Body)
if err != nil {
logger.Error("error reading request body", zap.Error(err))
w.WriteHeader(http.StatusInternalServerError)
Expand Down

0 comments on commit c5e4afa

Please sign in to comment.