func (s *Set) UnmarshalJSON(buf []byte) error {
	var ln string
	err := json.Unmarshal(buf, &ln)
	if err == nil && len(ln) > 0 {
		*s, err = ParseUnsafe(bytes.StringToByteArray(ln))
	} else {
		*s = EmptySet
	}
	return err
}
UnmarshalJSON to support json.Unmarshaller interface
package tag
import (
	"encoding/json"
	"github.com/logrange/logrange/pkg/utils/kvstring"
	"github.com/logrange/range/pkg/records"
	"github.com/logrange/range/pkg/utils/bytes"
	"sort"
	"strconv"
	"strings"
)
type (
	Line string
	tagMap map[string]string
	Set struct {
		line Line
		tmap tagMap
	}
)
var (
	EmptyLine = Line("")
	emptyMap  = tagMap(map[string]string{})
	EmptySet  = Set{"", emptyMap}
)
func ParseUnsafe(tags records.Record) (Set, error) {
	if len(tags) == 0 {
		return EmptySet, nil
	}
	m, err := kvstring.ToMap(bytes.ByteArrayToString(tags))
	if err != nil {
		return EmptySet, err
	}
	tm := tagMap(m)
	return Set{tm.line(), tm}, nil
}
func Parse(tags string) (Set, error) {
	return ParseUnsafe([]byte(tags))
}
func MapToSet(mp map[string]string) Set {
	if len(mp) == 0 {
		return EmptySet
	}
	tm := make(tagMap, len(mp))
	for k, v := range mp {
		tm[k] = v
	}
	return Set{tm.line(), tm}
}
func (s *Set) Line() Line {
	return s.line
}
func (s *Set) Tag(tag string) string {
	return s.tmap[tag]
}
func (s *Set) IsEmpty() bool {
	return len(s.tmap) == 0
}
func (s *Set) SubsetOf(s1 Set) bool {
	return s.tmap.subsetOf(s1.tmap)
}
func (s *Set) Equals(s1 Set) bool {
	return s.line == s1.line
}
func (s *Set) String() string {
	return string(s.line)
}
func (s *Set) MarshalJSON() ([]byte, error) {
	return json.Marshal(string(s.line))
}