2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-26 23:06:32 +00:00

Merge pull request #1024 from restic/remove-unused

Remove unused code/variables
This commit is contained in:
Alexander Neumann 2017-06-11 11:18:02 +02:00
commit a6f157f346
7 changed files with 0 additions and 46 deletions

View File

@ -8,10 +8,6 @@ import (
// TestFlags checks for double defined flags, the commands will panic on // TestFlags checks for double defined flags, the commands will panic on
// ParseFlags() when a shorthand flag is defined twice. // ParseFlags() when a shorthand flag is defined twice.
func TestFlags(t *testing.T) { func TestFlags(t *testing.T) {
type FlagParser interface {
ParseFlags([]string) error
}
for _, cmd := range cmdRoot.Commands() { for _, cmd := range cmdRoot.Commands() {
t.Run(cmd.Name(), func(t *testing.T) { t.Run(cmd.Name(), func(t *testing.T) {
cmd.Flags().SetOutput(ioutil.Discard) cmd.Flags().SetOutput(ioutil.Discard)

View File

@ -52,11 +52,6 @@ func nlink(info os.FileInfo) uint64 {
return uint64(stat.Nlink) 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 { func createFileSetPerHardlink(dir string) map[uint64][]string {
var stat syscall.Stat_t var stat syscall.Stat_t
linkTests := make(map[uint64][]string) linkTests := make(map[uint64][]string)

View File

@ -20,8 +20,6 @@ import (
"restic/backend" "restic/backend"
) )
const connLimit = 40
// make sure the rest backend implements restic.Backend // make sure the rest backend implements restic.Backend
var _ restic.Backend = &restBackend{} var _ restic.Backend = &restBackend{}

View File

@ -18,8 +18,6 @@ import (
"restic/debug" "restic/debug"
) )
const connLimit = 10
// Backend stores data on an S3 endpoint. // Backend stores data on an S3 endpoint.
type Backend struct { type Backend struct {
client *minio.Client client *minio.Client

View File

@ -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)
}

View File

@ -39,8 +39,6 @@ type file struct {
blobs [][]byte blobs [][]byte
} }
const defaultBlobSize = 128 * 1024
func newFile(repo BlobLoader, node *restic.Node, ownerIsRoot bool, blobsize *BlobSizeCache) (fusefile *file, err error) { 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)) debug.Log("create new file for %v with %d blobs", node.Name, len(node.Content))
var bytes uint64 var bytes uint64

View File

@ -8,16 +8,6 @@ import (
"restic/debug" "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, // ParallelWorkFunc gets one file ID to work on. If an error is returned,
// processing stops. When the contect is cancelled the function should return. // processing stops. When the contect is cancelled the function should return.
type ParallelWorkFunc func(ctx context.Context, id string) error type ParallelWorkFunc func(ctx context.Context, id string) error