I have slice as below 

```
{string, int }

[{zaa 1} {aab 1} {xac 1}]

```

in this case int side equal so no I need to sort using alphabetical order 

if my slice like bellow

```
[{zaa 1} {aab 4} {xac 2}]

```

I need to sort using numeric value, how can I do this?

Right now I'm using sort given by golang 

```
type ByStringValue []string
type ByNumericValue []WeightBaseResourceInfo

func (a ByStringValue) Len() int           { return len(a) }
func (a ByStringValue) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByStringValue) Less(i, j int) bool { return a[i] < a[j] }

func (a ByNumericValue) Len() int      { return len(a) }
func (a ByNumericValue) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a ByNumericValue) Less(i, j int) bool {
    w1 := a[i].Weight
    w2 := a[j].Weight
    return w1 > w2
}

```