postmanlabs / postman-code-generators

Common repository for all code generators shipped with Postman
Apache License 2.0
992 stars 350 forks source link

Suggest: changing the package go ioutil was deprecated support <1.16 to new native package io. #711

Closed Paulo-Lopes-Estevao closed 1 year ago

Paulo-Lopes-Estevao commented 1 year ago

Is your feature request related to a problem? Please describe. Package go ioutil was deprecated support <1.16 the same features are now in the io package and with more features and support.

Describe the solution you'd like

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

ioutil.ReadAll(res.Body)

to

import (
  "fmt"
  "strings"
  "net/http"
  "io"
)

io.ReadAll(res.Body)

Additional context

Screenshot 2023-06-21 at 10 32 58
kaifkh20 commented 1 year ago

io.ReadAll is only available ^1.16.

So basically when I try to change it two of the test cases fail. For now I think ioutil.ReadAll is fine as it will also work for version below 1.16.

Paulo-Lopes-Estevao commented 1 year ago

I understand it was a suggestion so far we have not broken compatibility and it is still working. I'll keep an eye on the future change anything mention.