github.com/spotmaxtech/k8s-apimachinery-v0260@v0.0.1/pkg/util/sets/ordered.go (about) 1 /* 2 Copyright 2022 The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package sets 18 19 // ordered is a constraint that permits any ordered type: any type 20 // that supports the operators < <= >= >. 21 // If future releases of Go add new ordered types, 22 // this constraint will be modified to include them. 23 type ordered interface { 24 integer | float | ~string 25 } 26 27 // integer is a constraint that permits any integer type. 28 // If future releases of Go add new predeclared integer types, 29 // this constraint will be modified to include them. 30 type integer interface { 31 signed | unsigned 32 } 33 34 // float is a constraint that permits any floating-point type. 35 // If future releases of Go add new predeclared floating-point types, 36 // this constraint will be modified to include them. 37 type float interface { 38 ~float32 | ~float64 39 } 40 41 // signed is a constraint that permits any signed integer type. 42 // If future releases of Go add new predeclared signed integer types, 43 // this constraint will be modified to include them. 44 type signed interface { 45 ~int | ~int8 | ~int16 | ~int32 | ~int64 46 } 47 48 // unsigned is a constraint that permits any unsigned integer type. 49 // If future releases of Go add new predeclared unsigned integer types, 50 // this constraint will be modified to include them. 51 type unsigned interface { 52 ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr 53 }