mirror of
https://github.com/octoleo/restic.git
synced 2024-12-23 03:18:55 +00:00
Remove unused code/variables
This commit is contained in:
parent
0b55be2581
commit
8d4417ec92
@ -8,10 +8,6 @@ import (
|
||||
// TestFlags checks for double defined flags, the commands will panic on
|
||||
// ParseFlags() when a shorthand flag is defined twice.
|
||||
func TestFlags(t *testing.T) {
|
||||
type FlagParser interface {
|
||||
ParseFlags([]string) error
|
||||
}
|
||||
|
||||
for _, cmd := range cmdRoot.Commands() {
|
||||
t.Run(cmd.Name(), func(t *testing.T) {
|
||||
cmd.Flags().SetOutput(ioutil.Discard)
|
||||
|
@ -52,11 +52,6 @@ func nlink(info os.FileInfo) uint64 {
|
||||
return uint64(stat.Nlink)
|
||||
}
|
||||
|
||||
func inode(info os.FileInfo) uint64 {
|
||||
stat, _ := info.Sys().(*syscall.Stat_t)
|
||||
return uint64(stat.Ino)
|
||||
}
|
||||
|
||||
func createFileSetPerHardlink(dir string) map[uint64][]string {
|
||||
var stat syscall.Stat_t
|
||||
linkTests := make(map[uint64][]string)
|
||||
|
@ -20,8 +20,6 @@ import (
|
||||
"restic/backend"
|
||||
)
|
||||
|
||||
const connLimit = 40
|
||||
|
||||
// make sure the rest backend implements restic.Backend
|
||||
var _ restic.Backend = &restBackend{}
|
||||
|
||||
|
@ -18,8 +18,6 @@ import (
|
||||
"restic/debug"
|
||||
)
|
||||
|
||||
const connLimit = 10
|
||||
|
||||
// Backend stores data on an S3 endpoint.
|
||||
type Backend struct {
|
||||
client *minio.Client
|
||||
|
@ -1,21 +0,0 @@
|
||||
package restic
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/restic/chunker"
|
||||
)
|
||||
|
||||
var bufPool = sync.Pool{
|
||||
New: func() interface{} {
|
||||
return make([]byte, chunker.MinSize)
|
||||
},
|
||||
}
|
||||
|
||||
func getBuf() []byte {
|
||||
return bufPool.Get().([]byte)
|
||||
}
|
||||
|
||||
func freeBuf(data []byte) {
|
||||
bufPool.Put(data)
|
||||
}
|
@ -39,8 +39,6 @@ type file struct {
|
||||
blobs [][]byte
|
||||
}
|
||||
|
||||
const defaultBlobSize = 128 * 1024
|
||||
|
||||
func newFile(repo BlobLoader, node *restic.Node, ownerIsRoot bool, blobsize *BlobSizeCache) (fusefile *file, err error) {
|
||||
debug.Log("create new file for %v with %d blobs", node.Name, len(node.Content))
|
||||
var bytes uint64
|
||||
|
@ -8,16 +8,6 @@ import (
|
||||
"restic/debug"
|
||||
)
|
||||
|
||||
func closeIfOpen(ch chan struct{}) {
|
||||
// only close ch when it is not already closed, in which the case statement runs.
|
||||
select {
|
||||
case <-ch:
|
||||
return
|
||||
default:
|
||||
close(ch)
|
||||
}
|
||||
}
|
||||
|
||||
// ParallelWorkFunc gets one file ID to work on. If an error is returned,
|
||||
// processing stops. When the contect is cancelled the function should return.
|
||||
type ParallelWorkFunc func(ctx context.Context, id string) error
|
||||
|
Loading…
Reference in New Issue
Block a user