func (w *TSharkFields) Init() error {
	newer, err := FileNewerThan(CacheFile("tsharkfieldsv3.gob.gz"), DirOfPathCommandUnsafe(TSharkBin()))
	if err == nil && newer {
		f := &FieldsAndProtos{
			Fields:    make(map[string]interface{}),
			Protocols: make(map[string]struct{}),
		}
		err = ReadGob(CacheFile("tsharkfieldsv3.gob.gz"), f)
		if err == nil {
			w.ser = f
			log.Infof("Read cached tshark fields.")
			return nil
		} else {
			log.Infof("Could not read cached tshark fields (%v) - regenerating...", err)
		}
	}
	err = w.InitNoCache()
	if err != nil {
		return err
	}
	err = WriteGob(CacheFile("tsharkfieldsv3.gob.gz"), w.ser)
	if err != nil {
		return err
	}
	return nil
}
Can be run asynchronously.
This ought to use interfaces to make it testable.
package termshark
import (
	"bufio"
	"encoding/gob"
	"os"
	"os/exec"
	"sort"
	"strings"
	"sync"
	log "github.com/sirupsen/logrus"
)
type FieldType uint
const (
	FT_NONE              FieldType = iota  
	FT_PROTOCOL          FieldType = iota
	FT_BOOLEAN           FieldType = iota  
	FT_CHAR              FieldType = iota  
	FT_UINT8             FieldType = iota
	FT_UINT16            FieldType = iota
	FT_UINT24            FieldType = iota  
	FT_UINT32            FieldType = iota
	FT_UINT40            FieldType = iota  
	FT_UINT48            FieldType = iota  
	FT_UINT56            FieldType = iota  
	FT_UINT64            FieldType = iota
	FT_INT8              FieldType = iota
	FT_INT16             FieldType = iota
	FT_INT24             FieldType = iota  
	FT_INT32             FieldType = iota
	FT_INT40             FieldType = iota  
	FT_INT48             FieldType = iota  
	FT_INT56             FieldType = iota  
	FT_INT64             FieldType = iota
	FT_IEEE_11073_SFLOAT FieldType = iota
	FT_IEEE_11073_FLOAT  FieldType = iota
	FT_FLOAT             FieldType = iota
	FT_DOUBLE            FieldType = iota
	FT_ABSOLUTE_TIME     FieldType = iota
	FT_RELATIVE_TIME     FieldType = iota
	FT_STRING            FieldType = iota
	FT_STRINGZ           FieldType = iota  
	FT_UINT_STRING       FieldType = iota  
	FT_ETHER             FieldType = iota
	FT_BYTES             FieldType = iota
	FT_UINT_BYTES        FieldType = iota
	FT_IPv4              FieldType = iota
	FT_IPv6              FieldType = iota
	FT_IPXNET            FieldType = iota
	FT_FRAMENUM          FieldType = iota  
	FT_PCRE              FieldType = iota  
	FT_GUID              FieldType = iota  
	FT_OID               FieldType = iota  
	FT_EUI64             FieldType = iota
	FT_AX25              FieldType = iota
	FT_VINES             FieldType = iota
	FT_REL_OID           FieldType = iota  
	FT_SYSTEM_ID         FieldType = iota
	FT_STRINGZPAD        FieldType = iota  
	FT_FCWWN             FieldType = iota
	FT_NUM_TYPES         FieldType = iota  
)
var FieldTypeMap = map[string]FieldType{
	"FT_NONE":              FT_NONE,
	"FT_PROTOCOL":          FT_PROTOCOL,
	"FT_BOOLEAN":           FT_BOOLEAN,
	"FT_CHAR":              FT_CHAR,
	"FT_UINT8":             FT_UINT8,
	"FT_UINT16":            FT_UINT16,
	"FT_UINT24":            FT_UINT24,
	"FT_UINT32":            FT_UINT32,
	"FT_UINT40":            FT_UINT40,
	"FT_UINT48":            FT_UINT48,
	"FT_UINT56":            FT_UINT56,
	"FT_UINT64":            FT_UINT64,
	"FT_INT8":              FT_INT8,
	"FT_INT16":             FT_INT16,
	"FT_INT24":             FT_INT24,
	"FT_INT32":             FT_INT32,
	"FT_INT40":             FT_INT40,
	"FT_INT48":             FT_INT48,
	"FT_INT56":             FT_INT56,
	"FT_INT64":             FT_INT64,
	"FT_IEEE_11073_SFLOAT": FT_IEEE_11073_SFLOAT,
	"FT_IEEE_11073_FLOAT":  FT_IEEE_11073_FLOAT,
	"FT_FLOAT":             FT_FLOAT,
	"FT_DOUBLE":            FT_DOUBLE,
	"FT_ABSOLUTE_TIME":     FT_ABSOLUTE_TIME,
	"FT_RELATIVE_TIME":     FT_RELATIVE_TIME,
	"FT_STRING":            FT_STRING,
	"FT_STRINGZ":           FT_STRINGZ,
	"FT_UINT_STRING":       FT_UINT_STRING,
	"FT_ETHER":             FT_ETHER,
	"FT_BYTES":             FT_BYTES,
	"FT_UINT_BYTES":        FT_UINT_BYTES,
	"FT_IPv4":              FT_IPv4,
	"FT_IPv6":              FT_IPv6,
	"FT_IPXNET":            FT_IPXNET,
	"FT_FRAMENUM":          FT_FRAMENUM,
	"FT_PCRE":              FT_PCRE,
	"FT_GUID":              FT_GUID,
	"FT_OID":               FT_OID,
	"FT_EUI64":             FT_EUI64,
	"FT_AX25":              FT_AX25,
	"FT_VINES":             FT_VINES,
	"FT_REL_OID":           FT_REL_OID,
	"FT_SYSTEM_ID":         FT_SYSTEM_ID,
	"FT_STRINGZPAD":        FT_STRINGZPAD,
	"FT_FCWWN":             FT_FCWWN,
	"FT_NUM_TYPES":         FT_NUM_TYPES,
}
func ParseFieldType(s string) (res FieldType, ok bool) {
	res, ok = FieldTypeMap[s]
	return
}
type Protocol string
type Field struct {
	Name string
	Type FieldType
}
type FieldsAndProtos struct {
	Fields    interface{}  
	Protocols map[string]struct{}
}
func init() {
	gob.Register(make(map[string]interface{}))
	gob.Register(Protocol(""))
	gob.Register(Field{})
}
type TSharkFields struct {
	once sync.Once
	ser  *FieldsAndProtos
}
type IPrefixCompleterCallback interface {
	Call([]string)
}
type IPrefixCompleter interface {
	Completions(prefix string, cb IPrefixCompleterCallback)
}
func NewFields() *TSharkFields {
	return &TSharkFields{}
}
func DeleteCachedFields() error {
	return os.Remove(CacheFile("tsharkfieldsv3.gob.gz"))
}