func (k Key) Less(k2 Key) bool {
	list1 := k.List()
	list2 := k2.List()
	for i, c1 := range list1 {
		if len(list2) < (i + 1) {
			return false
		}
		c2 := list2[i]
		if c1 < c2 {
			return true
		} else if c1 > c2 {
			return false
		}
	}
	return len(list1) < len(list2)
}
Less checks whether this key is sorted lower than another.
package datastore
import (
	"encoding/json"
	"path"
	"strings"
	dsq "github.com/ipfs/go-datastore/query"
	"github.com/google/uuid"
)
type Key struct {
	string
}
func NewKey(s string) Key {
	k := Key{s}
	k.Clean()
	return k
}
func RawKey(s string) Key {
	if len(s) == 0 {
		return Key{"/"}
	}
	if len(s) == 0 || s[0] != '/' || (len(s) > 1 && s[len(s)-1] == '/') {
		panic("invalid datastore key: " + s)
	}
	return Key{s}
}
func KeyWithNamespaces(ns []string) Key {
	return NewKey(strings.Join(ns, "/"))
}
func (k *Key) Clean() {
	switch {
	case len(k.string) == 0:
		k.string = "/"
	case k.string[0] == '/':
		k.string = path.Clean(k.string)
	default:
		k.string = path.Clean("/" + k.string)
	}
}
func (k Key) String() string {
	return k.string
}
func (k Key) Bytes() []byte {
	return []byte(k.string)
}
func (k Key) Equal(k2 Key) bool {
	return k.string == k2.string
}