21 lines
384 B
Go
21 lines
384 B
Go
package message
|
|
|
|
import "strings"
|
|
|
|
type JsonParamEntry struct {
|
|
Name string
|
|
Value any
|
|
}
|
|
|
|
type JsonParamEntrySortable []*JsonParamEntry
|
|
|
|
func (p JsonParamEntrySortable) Len() int {
|
|
return len(p)
|
|
}
|
|
func (p JsonParamEntrySortable) Less(i, j int) bool {
|
|
return strings.Compare(p[i].Name, p[j].Name) == -1
|
|
}
|
|
func (p JsonParamEntrySortable) Swap(i, j int) {
|
|
p[i], p[j] = p[j], p[i]
|
|
}
|