gitlab.com/evatix-go/core@v1.3.55/coreimpl/enumimpl/IntegersRangesOfAnyVal.go (about)

     1  package enumimpl
     2  
     3  import (
     4  	"reflect"
     5  	"sort"
     6  )
     7  
     8  func IntegersRangesOfAnyVal(anyValue interface{}) []int {
     9  	reflectValues := reflect.ValueOf(anyValue)
    10  	length := reflectValues.Len()
    11  	slice := make([]int, length)
    12  
    13  	for i := 0; i < length; i++ {
    14  		rfVal := reflectValues.Index(i)
    15  		anyVal := rfVal.Interface()
    16  
    17  		slice[i] = ConvEnumAnyValToInteger(anyVal)
    18  	}
    19  
    20  	sort.Ints(slice)
    21  
    22  	return slice
    23  }