fs/hash: move interface assertion to tests so it doesn't pull in spf13/flag
This commit is contained in:
parent
a69fc8b80d
commit
bc3ee977f4
2 changed files with 4 additions and 4 deletions
|
@ -11,7 +11,6 @@ import (
|
||||||
|
|
||||||
"github.com/ncw/rclone/backend/dropbox/dbhash"
|
"github.com/ncw/rclone/backend/dropbox/dbhash"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/spf13/pflag"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Type indicates a standard hashing algorithm
|
// Type indicates a standard hashing algorithm
|
||||||
|
@ -110,9 +109,6 @@ func (h Type) Type() string {
|
||||||
return "string"
|
return "string"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check it satisfies the interface
|
|
||||||
var _ pflag.Value = (*Type)(nil)
|
|
||||||
|
|
||||||
// fromTypes will return hashers for all the requested types.
|
// fromTypes will return hashers for all the requested types.
|
||||||
// The types must be a subset of SupportedHashes,
|
// The types must be a subset of SupportedHashes,
|
||||||
// and this function must support all types.
|
// and this function must support all types.
|
||||||
|
|
|
@ -6,10 +6,14 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ncw/rclone/fs/hash"
|
"github.com/ncw/rclone/fs/hash"
|
||||||
|
"github.com/spf13/pflag"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Check it satisfies the interface
|
||||||
|
var _ pflag.Value = (*hash.Type)(nil)
|
||||||
|
|
||||||
func TestHashSet(t *testing.T) {
|
func TestHashSet(t *testing.T) {
|
||||||
var h hash.Set
|
var h hash.Set
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue