Skip to content

Commit b04f487

Browse files
committed
fix license and goci-lint
1 parent abfeea9 commit b04f487

File tree

3 files changed

+53
-11
lines changed

3 files changed

+53
-11
lines changed

mapx/hashmap_example_test.go

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2021 ecodeclub
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
package mapx
216

317
import (
@@ -25,9 +39,9 @@ func (ts testStringData) Equals(other any) bool {
2539
func ExampleHashMap_Iterate() {
2640
hashMap := NewHashMap[testStringData, int](0)
2741
strArr := make([]string, 0)
28-
hashMap.Put(testStringData{data: "hello"}, 1)
29-
hashMap.Put(testStringData{data: "world"}, 2)
30-
hashMap.Put(testStringData{data: "ekit"}, 3)
42+
_ = hashMap.Put(testStringData{data: "hello"}, 1)
43+
_ = hashMap.Put(testStringData{data: "world"}, 2)
44+
_ = hashMap.Put(testStringData{data: "ekit"}, 3)
3145

3246
hashMap.Iterate(
3347
func(key testStringData, val int) bool {

mapx/linkedmap_example_test.go

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2021 ecodeclub
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
package mapx
216

317
import (
@@ -8,9 +22,9 @@ import (
822
func ExampleLinkedMap_Iterate() {
923
linkedMap := NewLinkedHashMap[testStringData, int](0)
1024
strArr := make([]string, 0)
11-
linkedMap.Put(testStringData{data: "hello"}, 1)
12-
linkedMap.Put(testStringData{data: "world"}, 2)
13-
linkedMap.Put(testStringData{data: "ekit"}, 3)
25+
_ = linkedMap.Put(testStringData{data: "hello"}, 1)
26+
_ = linkedMap.Put(testStringData{data: "world"}, 2)
27+
_ = linkedMap.Put(testStringData{data: "ekit"}, 3)
1428

1529
linkedMap.Iterate(
1630
func(key testStringData, val int) bool {

mapx/multi_map_example_test.go

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2021 ecodeclub
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
package mapx
216

317
import (
@@ -10,11 +24,11 @@ import (
1024
func ExampleMultiMap_Iterate() {
1125
multiMap := NewMultiHashMap[testStringData, int](0)
1226
arr := make([]pair.Pair[string, int], 0)
13-
multiMap.Put(testStringData{data: "hello"}, 1)
14-
multiMap.Put(testStringData{data: "world"}, 2)
15-
multiMap.Put(testStringData{data: "world"}, 3)
16-
multiMap.Put(testStringData{data: "world"}, 4)
17-
multiMap.Put(testStringData{data: "ekit"}, 3)
27+
_ = multiMap.Put(testStringData{data: "hello"}, 1)
28+
_ = multiMap.Put(testStringData{data: "world"}, 2)
29+
_ = multiMap.Put(testStringData{data: "world"}, 3)
30+
_ = multiMap.Put(testStringData{data: "world"}, 4)
31+
_ = multiMap.Put(testStringData{data: "ekit"}, 3)
1832

1933
multiMap.Iterate(
2034
func(key testStringData, val int) bool {

0 commit comments

Comments
 (0)