func (vf *File) getRawPackageList() []interface{} {
	var rawPackageList []interface{}
	for index, name := range packageNames {
		rawPackageListObject, found := vf.all[name]
		if !found {
			continue
		}
		if index != 0 {
			vf.all[packageNames[0]] = rawPackageListObject
			delete(vf.all, name)
		}
		var is bool
		rawPackageList, is = rawPackageListObject.([]interface{})
		if is {
			break
		}
	}
	return rawPackageList
}
getRawPackageList gets the array of items from all object.
package vendorfile
import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"sort"
)
const Name = "vendor.json"
type File struct {
	RootPath string  
	Comment string
	Ignore string
	Package []*Package
	all map[string]interface{}
}
type Package struct {
	field map[string]interface{}
	Remove bool
	Add bool
	Origin       string
	Path         string
	Tree         bool
	Revision     string
	RevisionTime string
	Version      string
	VersionExact string
	ChecksumSHA1 string
	Comment      string
}
func (pkg *Package) PathOrigin() string {
	if len(pkg.Origin) > 0 {
		return pkg.Origin
	}
	return pkg.Path
}
type packageList []*Package
func (list packageList) String() string {
	buf := &bytes.Buffer{}
	for _, item := range list {
		buf.WriteString("\t")
		buf.WriteString(fmt.Sprintf("(%v) ", item.field))
		if item.Remove {
			buf.WriteString(" X ")
		}
		buf.WriteString(item.Path)
		buf.WriteRune('\n')
	}
	buf.WriteRune('\n')
	return buf.String()
}
func allString(all map[string]interface{}) string {
	obj, _ := all["package"]
	buf := &bytes.Buffer{}
	for _, itemObj := range obj.([]interface{}) {
		item := itemObj.(map[string]interface{})
		buf.WriteString("\t")
		buf.WriteString(item["path"].(string))
		buf.WriteRune('\n')
	}
	buf.WriteRune('\n')
	return buf.String()
}
var (
	rootPathNames     = []string{"rootPath"}
	packageNames      = []string{"package", "Package"}
	ignoreNames       = []string{"ignore"}
	originNames       = []string{"origin"}
	pathNames         = []string{"path", "canonical", "Canonical", "vendor", "Vendor"}
	treeNames         = []string{"tree"}
	revisionNames     = []string{"revision", "Revision", "version", "Version"}
	revisionTimeNames = []string{"revisionTime", "RevisionTime", "versionTime", "VersionTime"}
	versionNames      = []string{"version"}
	versionExactNames = []string{"versionExact"}
	checksumSHA1Names = []string{"checksumSHA1"}
	commentNames      = []string{"comment", "Comment"}
)
type vendorPackageSort []interface{}
func (vp vendorPackageSort) Len() int      { return len(vp) }
func (vp vendorPackageSort) Swap(i, j int) { vp[i], vp[j] = vp[j], vp[i] }
func (vp vendorPackageSort) Less(i, j int) bool {
	a := vp[i].(map[string]interface{})
	b := vp[j].(map[string]interface{})
	aPath, _ := a[pathNames[0]].(string)
	bPath, _ := b[pathNames[0]].(string)
	if aPath == bPath {
		aOrigin, _ := a[originNames[0]].(string)
		bOrigin, _ := b[originNames[0]].(string)
		return len(aOrigin) > len(bOrigin)
	}
	return aPath < bPath
}
func setField(fieldObj interface{}, object map[string]interface{}, names []string) {
loop:
	for _, name := range names {
		raw, found := object[name]
		if !found {
			continue
		}
		switch field := fieldObj.(type) {
		default:
			panic("unknown type")
		case *string:
			value, is := raw.(string)
			if !is {
				continue loop
			}
			*field = value
			if len(value) != 0 {
				break loop
			}
		case *bool:
			value, is := raw.(bool)
			if !is {
				continue loop
			}
			*field = value
			if value == true {
				break loop
			}
		}
	}
}
func setObject(fieldObj interface{}, object map[string]interface{}, names []string, hideEmpty bool) {
	switch field := fieldObj.(type) {
	default:
		panic("unknown type")
	case string:
		for i, name := range names {
			if i != 0 || (hideEmpty && len(field) == 0) {
				delete(object, name)
				continue
			}
			object[name] = field
		}
	case bool:
		for i, name := range names {
			if i != 0 || (hideEmpty && field == false) {
				delete(object, name)
				continue
			}
			object[name] = field
		}
	}
}