func (sc *SiteCollection) Pop(s *Site) {
	sc.Remove(sc.Length() - 1)
}
Pop removes the last element from the collection
package magopie
import (
	"encoding/json"
	"fmt"
)
type Site struct {
	ID      string
	Name    string
	URL     string
	Enabled bool
}
type SiteCollection struct {
	list []Site
}
func (sc *SiteCollection) Length() int {
	return len(sc.list)
}
func (sc *SiteCollection) Get(idx int) *Site {
	if idx <= sc.Length() {
		return &sc.list[idx]
	}
	return nil
}
func (sc *SiteCollection) Clear() {
	sc.list = sc.list[:0]
}
func (sc *SiteCollection) Index(s *Site) int {
	for i, tst := range sc.list {
		if tst == *s {
			return i
		}
	}
	return -1
}
func (sc *SiteCollection) Insert(i int, s *Site) {
	if i < 0 || i > sc.Length() {
		fmt.Printf("Magopie-go:: Attempted to insert a site at an invalid index")
		return
	}
	sc.list = append(sc.list, Site{})
	copy(sc.list[i+1:], sc.list[i:])
	sc.list[i] = *s
}
func (sc *SiteCollection) Remove(i int) {
	if i < 0 || i > sc.Length() {
		fmt.Printf("Magopie-go:: Attempted to remove a site from an invalid index")
		return
	}
	copy(sc.list[i:], sc.list[i+1:])
	sc.list[len(sc.list)-1] = Site{}
	sc.list = sc.list[:len(sc.list)-1]
}
func (sc *SiteCollection) Push(s *Site) {
	sc.Insert(sc.Length(), s)
}