refactor: move from io/ioutil to io and os packages (#5266)
The io/ioutil package has been deprecated as of Go 1.16 [1]. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. [1]: https://golang.org/doc/go1.16#ioutil Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@@ -17,8 +17,8 @@ limitations under the License.
|
||||
package v1alpha2
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
apinetworkingv1alpha3 "istio.io/api/networking/v1alpha3"
|
||||
@@ -89,7 +89,7 @@ func TestStrategyRead(t *testing.T) {
|
||||
//g := gomega.NewGomegaWithT(t)
|
||||
|
||||
var str []byte
|
||||
file, err := ioutil.ReadFile("/Users/zry/go/src/kubesphere.io/kubesphere/config/samples/servicemesh_v1alpha2_strategy.yaml")
|
||||
file, err := os.ReadFile("/Users/zry/go/src/kubesphere.io/kubesphere/config/samples/servicemesh_v1alpha2_strategy.yaml")
|
||||
if err == nil {
|
||||
obj, _, _ := scheme.Codecs.UniversalDeserializer().Decode(file, nil, &Strategy{})
|
||||
switch obj.(type) {
|
||||
|
||||
Reference in New Issue
Block a user