mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-06-02 21:49:25 +00:00
4df9c8d6a5
* github.com/russross/meddler v1.0.0 -> v1.0.1 * github.com/gin-gonic/gin v1.6.3 -> v1.7.4 * github.com/go-sql-driver/mysql v1.5.0 -> v1.6.0 * github.com/sirupsen/logrus v1.6.0 -> v1.8.1 * github.com/rs/zerolog v1.18.0 -> v1.25.0
24 lines
566 B
Go
24 lines
566 B
Go
// +build !go1.12
|
|
|
|
package fmtsort
|
|
|
|
import "reflect"
|
|
|
|
const brokenNaNs = true
|
|
|
|
func mapElems(mapValue reflect.Value) ([]reflect.Value, []reflect.Value) {
|
|
key := mapValue.MapKeys()
|
|
value := make([]reflect.Value, 0, len(key))
|
|
for _, k := range key {
|
|
v := mapValue.MapIndex(k)
|
|
if !v.IsValid() {
|
|
// Note: we can't retrieve the value, probably because
|
|
// the key is NaN, so just do the best we can and
|
|
// add a zero value of the correct type in that case.
|
|
v = reflect.Zero(mapValue.Type().Elem())
|
|
}
|
|
value = append(value, v)
|
|
}
|
|
return key, value
|
|
}
|