diff --git a/go.mod b/go.mod index e695ebb1..490b0a4c 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/openinfradev/tks-api -go 1.20 +go 1.19 require ( github.com/Nerzal/gocloak/v13 v13.1.0 diff --git a/internal/route/route.go b/internal/route/route.go index 4459a877..7edbd419 100644 --- a/internal/route/route.go +++ b/internal/route/route.go @@ -5,7 +5,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "net/http" "time" @@ -216,7 +215,7 @@ func loggingMiddleware(next http.Handler) http.Handler { if err == nil { log.InfoWithContext(r.Context(), fmt.Sprintf("REQUEST BODY : %s", bytes.NewBuffer(body).String())) } - r.Body = ioutil.NopCloser(bytes.NewBuffer(body)) + r.Body = io.NopCloser(bytes.NewBuffer(body)) next.ServeHTTP(w, r) diff --git a/pkg/api-client/api-client.go b/pkg/api-client/api-client.go index 6e6c4260..47f1ef05 100644 --- a/pkg/api-client/api-client.go +++ b/pkg/api-client/api-client.go @@ -4,7 +4,7 @@ import ( "bytes" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "time" @@ -72,7 +72,7 @@ func (c *ApiClientImpl) Get(path string) (out interface{}, err error) { return nil, fmt.Errorf("Failed to call api server.") } - body, err := ioutil.ReadAll(res.Body) + body, err := io.ReadAll(res.Body) if err != nil { return nil, err } @@ -132,7 +132,7 @@ func (c *ApiClientImpl) callWithBody(prefix string, method string, path string, return nil, fmt.Errorf("Failed to call api server.") } - body, err := ioutil.ReadAll(res.Body) + body, err := io.ReadAll(res.Body) if err != nil { return nil, err } diff --git a/pkg/argo-client/client.go b/pkg/argo-client/client.go index 4fafcd49..b100b5a4 100644 --- a/pkg/argo-client/client.go +++ b/pkg/argo-client/client.go @@ -4,7 +4,7 @@ import ( "bytes" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "time" @@ -64,7 +64,7 @@ func (c *ArgoClientImpl) GetWorkflowTemplates(namespace string) (*GetWorkflowTem } }() - body, err := ioutil.ReadAll(res.Body) + body, err := io.ReadAll(res.Body) if err != nil { return nil, err } @@ -95,7 +95,7 @@ func (c *ArgoClientImpl) GetWorkflow(namespace string, workflowName string) (*Wo } }() - body, err := ioutil.ReadAll(res.Body) + body, err := io.ReadAll(res.Body) if err != nil { return nil, err } @@ -128,7 +128,7 @@ func (c *ArgoClientImpl) GetWorkflowLog(namespace string, container string, work } }() - body, err := ioutil.ReadAll(res.Body) + body, err := io.ReadAll(res.Body) if err != nil { return logs, err } @@ -154,7 +154,7 @@ func (c *ArgoClientImpl) GetWorkflows(namespace string) (*GetWorkflowsResponse, } }() - body, err := ioutil.ReadAll(res.Body) + body, err := io.ReadAll(res.Body) if err != nil { return nil, err } @@ -204,7 +204,7 @@ func (c *ArgoClientImpl) SumbitWorkflowFromWftpl(wftplName string, opts SubmitOp } }() - body, err := ioutil.ReadAll(res.Body) + body, err := io.ReadAll(res.Body) if err != nil { return "", err } diff --git a/pkg/log/log.go b/pkg/log/log.go index 039bd547..5ad235dd 100644 --- a/pkg/log/log.go +++ b/pkg/log/log.go @@ -2,7 +2,7 @@ package log import ( "context" - "io/ioutil" + "io" "os" "strings" @@ -109,5 +109,5 @@ func Fatalf(format string, v ...interface{}) { } func Disable() { - logger.Out = ioutil.Discard + logger.Out = io.Discard } diff --git a/pkg/thanos-client/client.go b/pkg/thanos-client/client.go index 1cdf034c..61a602b7 100644 --- a/pkg/thanos-client/client.go +++ b/pkg/thanos-client/client.go @@ -3,7 +3,7 @@ package thanos import ( "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "net/url" "time" @@ -63,7 +63,7 @@ func (c *ThanosClientImpl) Get(query string) (out Metric, err error) { } }() - body, err := ioutil.ReadAll(res.Body) + body, err := io.ReadAll(res.Body) if err != nil { return out, err } @@ -100,7 +100,7 @@ func (c *ThanosClientImpl) FetchRange(query string, start int, end int, step int } }() - body, err := ioutil.ReadAll(res.Body) + body, err := io.ReadAll(res.Body) if err != nil { return out, err }