diff --git a/go/server.go b/go/server.go index 23fbe03d..4581b7fa 100644 --- a/go/server.go +++ b/go/server.go @@ -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. @@ -16,7 +16,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "io" "log" "net/http" "os" @@ -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) } @@ -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) diff --git a/tensorflow-serving/server.go b/tensorflow-serving/server.go index d45c2c17..db06e0b3 100644 --- a/tensorflow-serving/server.go +++ b/tensorflow-serving/server.go @@ -3,7 +3,7 @@ package main import ( "encoding/json" "fmt" - "io/ioutil" + "io" "log" "net" "net/http" @@ -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)