File tree 4 files changed +63
-17
lines changed
4 files changed +63
-17
lines changed Original file line number Diff line number Diff line change 4
4
build :
5
5
strategy :
6
6
matrix :
7
- go-version : [1.19 .x, 1.20 .x]
7
+ go-version : [1.20 .x, 1.21 .x]
8
8
platform : [windows-latest]
9
9
runs-on : ${{ matrix.platform }}
10
10
steps :
24
24
test :
25
25
strategy :
26
26
matrix :
27
- go-version : [1.19 .x, 1.20 .x]
27
+ go-version : [1.20 .x, 1.21 .x]
28
28
platform : [ubuntu-latest, macos-latest]
29
29
runs-on : ${{ matrix.platform }}
30
30
steps :
56
56
- name : Install Go
57
57
uses : actions/setup-go@v3
58
58
with :
59
- go-version : 1.20 .x
59
+ go-version : 1.21 .x
60
60
- name : Add GOBIN to PATH
61
61
run : echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
62
62
- name : Install dependencies
Original file line number Diff line number Diff line change @@ -213,17 +213,3 @@ func (s Set[T]) Clone() Set[T] {
213
213
func (s Set [T ]) SymmetricDifference (s2 Set [T ]) Set [T ] {
214
214
return s .Difference (s2 ).Union (s2 .Difference (s ))
215
215
}
216
-
217
- // Clear empties the set.
218
- // It is preferable to replace the set with a newly constructed set,
219
- // but not all callers can do that (when there are other references to the map).
220
- // In some cases the set *won't* be fully cleared, e.g. a Set[float32] containing NaN
221
- // can't be cleared because NaN can't be removed.
222
- // For sets containing items of a type that is reflexive for ==,
223
- // this is optimized to a single call to runtime.mapclear().
224
- func (s Set [T ]) Clear () Set [T ] {
225
- for key := range s {
226
- delete (s , key )
227
- }
228
- return s
229
- }
Original file line number Diff line number Diff line change
1
+ //go:build !go1.21
2
+
3
+ /*
4
+ Copyright 2023 The Kubernetes Authors.
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License");
7
+ you may not use this file except in compliance with the License.
8
+ You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
17
+ */
18
+
19
+ package set
20
+
21
+ // Clear empties the set.
22
+ // It is preferable to replace the set with a newly constructed set,
23
+ // but not all callers can do that (when there are other references to the map).
24
+ // In some cases the set *won't* be fully cleared, e.g. a Set[float32] containing NaN
25
+ // can't be cleared because NaN can't be removed.
26
+ // For sets containing items of a type that is reflexive for ==,
27
+ // this is optimized to a single call to runtime.mapclear().
28
+ func (s Set [T ]) Clear () Set [T ] {
29
+ for key := range s {
30
+ delete (s , key )
31
+ }
32
+ return s
33
+ }
Original file line number Diff line number Diff line change
1
+ //go:build go1.21
2
+
3
+ /*
4
+ Copyright 2023 The Kubernetes Authors.
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License");
7
+ you may not use this file except in compliance with the License.
8
+ You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
17
+ */
18
+
19
+ package set
20
+
21
+ // Clear empties the set.
22
+ // It is preferable to replace the set with a newly constructed set,
23
+ // but not all callers can do that (when there are other references to the map).
24
+ func (s Set [T ]) Clear () Set [T ] {
25
+ clear (s )
26
+ return s
27
+ }
You can’t perform that action at this time.
0 commit comments