mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-04 13:52:26 +08:00
22 lines
356 B
Go
22 lines
356 B
Go
// Package main provides ...
|
|
package main
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestUpload(t *testing.T) {
|
|
path := "/Users/chen/Desktop/png-MicroService-by-StuQ.png"
|
|
file, err := os.Open(path)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
info, _ := file.Stat()
|
|
url, err := FileUpload(info.Name(), info.Size(), file)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(url)
|
|
}
|