fix: use of ioutil package (#5261)
* fix ioutil.NopCloser * fix ioutil.ReadAll * fix ioutil.ReadFile * fix ioutil.WriteFile * run goimports -w -format-only ./ * update CHANGELOG.md
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
package orm
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/beego/beego/v2/client/orm/internal/models"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func Test_getColumnTyp(t *testing.T) {
|
||||
|
||||
@@ -19,7 +19,6 @@ import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -118,7 +117,7 @@ func getCaller(skip int) string {
|
||||
pc, file, line, _ := runtime.Caller(skip)
|
||||
fun := runtime.FuncForPC(pc)
|
||||
_, fn := filepath.Split(file)
|
||||
data, err := ioutil.ReadFile(file)
|
||||
data, err := os.ReadFile(file)
|
||||
var codes []string
|
||||
if err == nil {
|
||||
lines := bytes.Split(data, []byte{'\n'})
|
||||
|
||||
Reference in New Issue
Block a user