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

Commit

Permalink
clinte, dfget, supernode: delete unused functions based on static check
Browse files Browse the repository at this point in the history
Signed-off-by: hwdef <[email protected]>
  • Loading branch information
hwdef committed Sep 27, 2019
1 parent 71d3b08 commit 63bac9f
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 30 deletions.
5 changes: 2 additions & 3 deletions dfget/core/uploader/peer_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ var (
)

type PeerServerTestSuite struct {
workHome string
servicePath string
srv *peerServer
workHome string
srv *peerServer
}

func (s *PeerServerTestSuite) SetUpSuite(c *check.C) {
Expand Down
12 changes: 0 additions & 12 deletions dfget/core/uploader/uploader_helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,6 @@ func (u uploadHeader) newRange(rangeStr string) uploadHeader {
return newU
}

func (u uploadHeader) newNum(num int) uploadHeader {
newU := u
newU.num = fmt.Sprintf("%d", num)
return newU
}

func (u uploadHeader) newSize(size int) uploadHeader {
newU := u
newU.size = fmt.Sprintf("%d", size)
return newU
}

// ----------------------------------------------------------------------------
// upload param

Expand Down
1 change: 0 additions & 1 deletion dfget/core/uploader/uploader_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ func init() {

type UploaderUtilTestSuite struct {
workHome string
host string
ip string
port int
server *http.Server
Expand Down
14 changes: 0 additions & 14 deletions supernode/daemon/mgr/progress/state_sync_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,6 @@ func (mmap *stateSyncMap) getAsPieceState(key string) (*pieceState, error) {
return nil, errors.Wrapf(errortypes.ErrConvertFailed, "key %s: %v", key, v)
}

// getAsSuperLoadState returns result as *superLoadState.
// The ErrConvertFailed error will be returned if the assertion fails.
func (mmap *stateSyncMap) getAsSuperLoadState(key string) (*superLoadState, error) {
v, err := mmap.get(key)
if err != nil {
return nil, errors.Wrapf(err, "key: %s", key)
}

if value, ok := v.(*superLoadState); ok {
return value, nil
}
return nil, errors.Wrapf(errortypes.ErrConvertFailed, "key %s: %v", key, v)
}

// remove deletes the key-value pair from the mmap.
// The ErrEmptyValue error will be returned if the key is empty.
// And the ErrDataNotFound error will be returned if the key cannot be found.
Expand Down

0 comments on commit 63bac9f

Please sign in to comment.