Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Commit 63bac9f

Browse files
committed
clinte, dfget, supernode: delete unused functions based on static check
Signed-off-by: hwdef <[email protected]>
1 parent 71d3b08 commit 63bac9f

File tree

4 files changed

+2
-30
lines changed

4 files changed

+2
-30
lines changed

dfget/core/uploader/peer_server_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ var (
5353
)
5454

5555
type PeerServerTestSuite struct {
56-
workHome string
57-
servicePath string
58-
srv *peerServer
56+
workHome string
57+
srv *peerServer
5958
}
6059

6160
func (s *PeerServerTestSuite) SetUpSuite(c *check.C) {

dfget/core/uploader/uploader_helper_test.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,6 @@ func (u uploadHeader) newRange(rangeStr string) uploadHeader {
126126
return newU
127127
}
128128

129-
func (u uploadHeader) newNum(num int) uploadHeader {
130-
newU := u
131-
newU.num = fmt.Sprintf("%d", num)
132-
return newU
133-
}
134-
135-
func (u uploadHeader) newSize(size int) uploadHeader {
136-
newU := u
137-
newU.size = fmt.Sprintf("%d", size)
138-
return newU
139-
}
140-
141129
// ----------------------------------------------------------------------------
142130
// upload param
143131

dfget/core/uploader/uploader_util_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ func init() {
3636

3737
type UploaderUtilTestSuite struct {
3838
workHome string
39-
host string
4039
ip string
4140
port int
4241
server *http.Server

supernode/daemon/mgr/progress/state_sync_map.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,6 @@ func (mmap *stateSyncMap) getAsPieceState(key string) (*pieceState, error) {
102102
return nil, errors.Wrapf(errortypes.ErrConvertFailed, "key %s: %v", key, v)
103103
}
104104

105-
// getAsSuperLoadState returns result as *superLoadState.
106-
// The ErrConvertFailed error will be returned if the assertion fails.
107-
func (mmap *stateSyncMap) getAsSuperLoadState(key string) (*superLoadState, error) {
108-
v, err := mmap.get(key)
109-
if err != nil {
110-
return nil, errors.Wrapf(err, "key: %s", key)
111-
}
112-
113-
if value, ok := v.(*superLoadState); ok {
114-
return value, nil
115-
}
116-
return nil, errors.Wrapf(errortypes.ErrConvertFailed, "key %s: %v", key, v)
117-
}
118-
119105
// remove deletes the key-value pair from the mmap.
120106
// The ErrEmptyValue error will be returned if the key is empty.
121107
// And the ErrDataNotFound error will be returned if the key cannot be found.

0 commit comments

Comments
 (0)