diff --git a/README.md b/README.md index 44833a3..3d1ece1 100644 --- a/README.md +++ b/README.md @@ -81,3 +81,7 @@ Copyright © 2018 Igor Mikushkin <igor.mikushkin@gmail.com>. This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See the LICENSE file for more details. + +### Thanks to + +[![JetBrains](svg/jetbrains.svg)](https://www.jetbrains.com/?from=treemap) diff --git a/debug_test.go b/debug_test.go index 3f5ce7a..38ae71f 100644 --- a/debug_test.go +++ b/debug_test.go @@ -34,6 +34,7 @@ func graphvizEdges(node *node) string { } // nolint: megacheck +//noinspection GoUnusedFunction func graphviz(node *node) string { return "digraph {\nnode [style=filled]\n" + graphvizNodes(node) + graphvizEdges(node) + "}\n" } diff --git a/example/gotemplate_intStringTreeMap.go b/example/gotemplate_intStringTreeMap.go index 422b816..a539ea2 100644 --- a/example/gotemplate_intStringTreeMap.go +++ b/example/gotemplate_intStringTreeMap.go @@ -342,6 +342,7 @@ func (t *intStringTreeMap) insertFixup(x *nodeIntStringTreeMap) { } // nolint: gocyclo +//noinspection GoNilness func removeNodeIntStringTreeMap(root *nodeIntStringTreeMap, z *nodeIntStringTreeMap) { var y *nodeIntStringTreeMap if z.left == nil || z.right == nil { diff --git a/example/random_test.go b/example/random_test.go index 86c4d90..071cfb0 100644 --- a/example/random_test.go +++ b/example/random_test.go @@ -15,6 +15,7 @@ type TreeMap = intStringTreeMap const NumIters = 10000 const RandMax = 40 +//noinspection GoNilness func min(kv map[Key]Value) Key { if len(kv) == 0 { return 0 @@ -29,6 +30,7 @@ func min(kv map[Key]Value) Key { return *key } +//noinspection GoNilness func max(kv map[Key]Value) Key { if len(kv) == 0 { return 0 diff --git a/example/treemap_test.go b/example/treemap_test.go index ba59c33..531b406 100644 --- a/example/treemap_test.go +++ b/example/treemap_test.go @@ -113,7 +113,8 @@ func TestClear(t *testing.T) { } func testRange(t *testing.T, it, end forwardIteratorIntStringTreeMap, exp []string) { - var got []string + //noinspection GoPreferNilSlice + got := []string{} for ; it != end; it.Next() { got = append(got, it.Value()) } diff --git a/svg/jetbrains.svg b/svg/jetbrains.svg new file mode 100644 index 0000000..52e7822 --- /dev/null +++ b/svg/jetbrains.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/treemap.go b/treemap.go index 18389a5..4bda993 100644 --- a/treemap.go +++ b/treemap.go @@ -340,6 +340,7 @@ func (t *TreeMap) insertFixup(x *node) { } // nolint: gocyclo +//noinspection GoNilness func removeNode(root *node, z *node) { var y *node if z.left == nil || z.right == nil { diff --git a/treemap_test.go b/treemap_test.go index 7adf880..e67d033 100644 --- a/treemap_test.go +++ b/treemap_test.go @@ -115,7 +115,8 @@ func TestClear(t *testing.T) { } func testRange(t *testing.T, it, end ForwardIterator, exp []Value) { - var got []Value + //noinspection GoPreferNilSlice + got := []Value{} for ; it != end; it.Next() { got = append(got, it.Value()) }