Introduce staticcheck for stricter builds (#7035)

This commit is contained in:
Harshavardhana
2019-02-13 04:59:36 -08:00
committed by Nitish Tiwari
parent 4ba77a916d
commit df35d7db9d
71 changed files with 274 additions and 777 deletions

View File

@@ -22,8 +22,7 @@ import (
// Simply make sure creating a new tree works.
func TestNewTrie(t *testing.T) {
var trie *Trie
trie = NewTrie()
trie := NewTrie()
if trie.size != 0 {
t.Errorf("expected size 0, got: %d", trie.size)
@@ -32,8 +31,7 @@ func TestNewTrie(t *testing.T) {
// Ensure that we can insert new keys into the tree, then check the size.
func TestInsert(t *testing.T) {
var trie *Trie
trie = NewTrie()
trie := NewTrie()
// We need to have an empty tree to begin with.
if trie.size != 0 {
@@ -51,8 +49,7 @@ func TestInsert(t *testing.T) {
// Ensure that PrefixMatch gives us the correct two keys in the tree.
func TestPrefixMatch(t *testing.T) {
var trie *Trie
trie = NewTrie()
trie := NewTrie()
// Feed it some fodder: only 'minio' and 'miny-os' should trip the matcher.
trie.Insert("minio")