21 lines
360 B
Go
21 lines
360 B
Go
package file
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestFile(t *testing.T) {
|
|
var meta FileMeta
|
|
meta.DirRoot = "FTP"
|
|
meta.Province = "BJ"
|
|
meta.DeviceCode = "0001"
|
|
meta.Index = "001"
|
|
meta.Time = time.Now().Format("20060102150405")
|
|
meta.Compress = false
|
|
content := "this a test file"
|
|
f, err := GenFile(&meta, []byte(content))
|
|
fmt.Println(f, err)
|
|
}
|