utils_test.go
342 字节
package aliyun
import (
"bytes"
"testing"
)
func Test_GetFile(t *testing.T) {
io, err := GetFileFromUrl("http://mmm-opp-dev.fjmaimaimai.com/file/opp/image/20200106/1578297295_RxJscRHCzQmxeseTAEQXTH7A7ZK6z4Fz.jpg")
if err != nil {
t.Log(err)
return
}
var buf bytes.Buffer
n, _ := buf.ReadFrom(io)
t.Log("read from reader:", n)
}