mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
Fix vendor out of sync issue
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
21a02fb559
commit
e128caddc5
7
vendor/github.com/go-openapi/swag/convert.go
generated
vendored
7
vendor/github.com/go-openapi/swag/convert.go
generated
vendored
@ -39,11 +39,12 @@ func IsFloat64AJSONInteger(f float64) bool {
|
||||
diff := math.Abs(f - g)
|
||||
|
||||
// more info: https://floating-point-gui.de/errors/comparison/#look-out-for-edge-cases
|
||||
if f == g { // best case
|
||||
switch {
|
||||
case f == g: // best case
|
||||
return true
|
||||
} else if f == float64(int64(f)) || f == float64(uint64(f)) { // optimistic case
|
||||
case f == float64(int64(f)) || f == float64(uint64(f)): // optimistic case
|
||||
return true
|
||||
} else if f == 0 || g == 0 || diff < math.SmallestNonzeroFloat64 { // very close to 0 values
|
||||
case f == 0 || g == 0 || diff < math.SmallestNonzeroFloat64: // very close to 0 values
|
||||
return diff < (epsilon * math.SmallestNonzeroFloat64)
|
||||
}
|
||||
// check the relative error
|
||||
|
2
vendor/github.com/go-openapi/swag/json.go
generated
vendored
2
vendor/github.com/go-openapi/swag/json.go
generated
vendored
@ -99,7 +99,7 @@ func ConcatJSON(blobs ...[]byte) []byte {
|
||||
last := len(blobs) - 1
|
||||
for blobs[last] == nil || bytes.Equal(blobs[last], nullJSON) {
|
||||
// strips trailing null objects
|
||||
last = last - 1
|
||||
last--
|
||||
if last < 0 {
|
||||
// there was nothing but "null"s or nil...
|
||||
return nil
|
||||
|
21
vendor/github.com/go-openapi/swag/util.go
generated
vendored
21
vendor/github.com/go-openapi/swag/util.go
generated
vendored
@ -28,6 +28,14 @@ var initialisms []string
|
||||
|
||||
var isInitialism func(string) bool
|
||||
|
||||
// GoNamePrefixFunc sets an optional rule to prefix go names
|
||||
// which do not start with a letter.
|
||||
//
|
||||
// e.g. to help converting "123" into "{prefix}123"
|
||||
//
|
||||
// The default is to prefix with "X"
|
||||
var GoNamePrefixFunc func(string) string
|
||||
|
||||
func init() {
|
||||
// Taken from https://github.com/golang/lint/blob/3390df4df2787994aea98de825b964ac7944b817/lint.go#L732-L769
|
||||
var configuredInitialisms = map[string]bool{
|
||||
@ -288,8 +296,17 @@ func ToGoName(name string) string {
|
||||
}
|
||||
|
||||
if len(result) > 0 {
|
||||
if !unicode.IsUpper([]rune(result)[0]) {
|
||||
result = "X" + result
|
||||
// Only prefix with X when the first character isn't an ascii letter
|
||||
first := []rune(result)[0]
|
||||
if !unicode.IsLetter(first) || (first > unicode.MaxASCII && !unicode.IsUpper(first)) {
|
||||
if GoNamePrefixFunc == nil {
|
||||
return "X" + result
|
||||
}
|
||||
result = GoNamePrefixFunc(name) + result
|
||||
}
|
||||
first = []rune(result)[0]
|
||||
if unicode.IsLetter(first) && !unicode.IsUpper(first) {
|
||||
result = string(append([]rune{unicode.ToUpper(first)}, []rune(result)[1:]...))
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user