func (tg *Tag) setImageID(s string) {
	tg.imageID = cutImageID(s)
}
setImageID sets local Docker image ID
package tag
import (
	"errors"
	"sort"
	"strconv"
	"strings"
	"time"
)
type Tag struct {
	name    string
	digest  string
	imageID string
	created int64
	state   string
}
type Options struct {
	Digest  string
	ImageID string
	Created int64
}
func (tg *Tag) SortKey() string {
	return tg.GetCreatedKey() + tg.name
}
func (tg *Tag) Name() string {
	return tg.name
}
func (tg *Tag) GetDigest() string {
	return tg.digest
}
func (tg *Tag) GetShortDigest() string {
	const limit = 40
	if len(tg.digest) < limit {
		return tg.digest
	}
	return tg.digest[0:limit]
}
func cutImageID(s string) string {
	fields := strings.Split(s, ":")
	var id string
	if len(fields) < 2 {
		id = s
	} else {
		id = fields[1]
	}
	if len(id) > 12 {
		return id[0:12]
	}
	return id
}