mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-17 13:53:41 +00:00
feat: support use server time for file creation (#359)
This commit is contained in:
20 files changed
+192
-75
No files matched your search
@@ -4,12 +4,14 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/GopeedLab/gopeed/pkg/base"
|
||||
"github.com/armon/go-socks5"
|
||||
"io"
|
||||
"math/rand"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
@@ -337,3 +339,11 @@ func StartSocks5Server(usr, pwd string) net.Listener {
|
||||
go server.Serve(listener)
|
||||
return listener
|
||||
}
|
||||
|
||||
func AssertResourceEqual(want, got *base.Resource) bool {
|
||||
// Ignore ctime
|
||||
if got != nil && len(got.Files) > 0 {
|
||||
got.Files[0].Ctime = nil
|
||||
}
|
||||
return reflect.DeepEqual(want, got)
|
||||
}
|
||||
Reference in new issue
Block a user