func (o MirrorRepos) Less(i, j int) bool {
	return strings.ToLower(o[i].Original) < strings.ToLower(o[j].Original)
}
Less is needed for the sort interface. It compares two MirrorRepos based on
their original value.
package mirrors
import (
	"io/ioutil"
	"sort"
	"strings"
	"gopkg.in/yaml.v2"
)
type Mirrors struct {
	Repos MirrorRepos `yaml:"repos"`
}
func (ov *Mirrors) Marshal() ([]byte, error) {
	yml, err := yaml.Marshal(&ov)
	if err != nil {
		return []byte{}, err
	}
	return yml, nil
}
func (ov *Mirrors) WriteFile(opath string) error {
	o, err := ov.Marshal()
	if err != nil {
		return err
	}
	return ioutil.WriteFile(opath, o, 0666)
}
func ReadMirrorsFile(opath string) (*Mirrors, error) {
	yml, err := ioutil.ReadFile(opath)
	if err != nil {
		return nil, err
	}
	ov, err := FromYaml(yml)
	if err != nil {
		return nil, err
	}
	return ov, nil
}
func FromYaml(yml []byte) (*Mirrors, error) {
	ov := &Mirrors{}
	err := yaml.Unmarshal([]byte(yml), &ov)
	return ov, err
}
func (ov *Mirrors) MarshalYAML() (interface{}, error) {
	sort.Sort(ov.Repos)
	return ov, nil
}
type MirrorRepos []*MirrorRepo
func (o MirrorRepos) Len() int {
	return len(o)
}