mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-27 16:17:34 +00:00
Refactor: move from io/ioutil to io and os package (#2234)
The io/ioutil package has been deprecated as of Go 1.16, see https://golang.org/doc/go1.16#ioutil. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. Signed-off-by: Eng Zer Jun <zerjun@beatchain.co>
This commit is contained in:
@@ -19,7 +19,7 @@ package utils
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -218,7 +218,7 @@ func TestFixOpenAPISchema(t *testing.T) {
|
||||
schema := swagger.Components.Schemas[model.ParameterFieldName].Value
|
||||
fixOpenAPISchema("", schema)
|
||||
fixedSchema, _ := schema.MarshalJSON()
|
||||
expectedSchema, _ := ioutil.ReadFile(filepath.Join(TestDir, tc.fixedFile))
|
||||
expectedSchema, _ := os.ReadFile(filepath.Join(TestDir, tc.fixedFile))
|
||||
assert.Equal(t, string(fixedSchema), string(expectedSchema))
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user