func setupTagfileBag(bagName string) (*bagins.Bag, error) {
	bag, err := setupCustomBag(bagName)
	if err != nil {
		return nil, err
	}
	bag.AddTagfile("laser-tag.txt")
	customTagFile1, _ := bag.TagFile("laser-tag.txt")
	customTagFile1.Data.SetFields([]bagins.TagField{
		*bagins.NewTagField("tic", "tac"),
		*bagins.NewTagField("tick", "tock"),
	})
	bag.AddTagfile("custom-tags/player-stats.txt")
	customTagFile2, _ := bag.TagFile("custom-tags/player-stats.txt")
	customTagFile2.Data.SetFields([]bagins.TagField{
		*bagins.NewTagField("Batting-Average", ".340"),
		*bagins.NewTagField("What-Time-Is-It", "2016-06-01T12:00:00Z"),
		*bagins.NewTagField("ERA", "1.63"),
		*bagins.NewTagField("Bats", "Left"),
		*bagins.NewTagField("Throws", "Right"),
	})
	bag.AddTagfile("custom-tags/tv-schedule.txt")
	customTagFile3, _ := bag.TagFile("custom-tags/tv-schedule.txt")
	customTagFile3.Data.SetFields([]bagins.TagField{
		*bagins.NewTagField("3:00PM", "House Party"),
		*bagins.NewTagField("4:00PM", "Dexter"),
	})
	errors := bag.Save()
	if errors != nil && len(errors) > 0 {
		return nil, errors[0]
	}
	return bag, nil
}
Setups up a bag with custom tag files, a custom tag directory,
and a tag manifest.
package bagins_test
import (
	"github.com/APTrust/bagins"
	"io/ioutil"
	"os"
	"path/filepath"
	"testing"
)
const (
	FIXSTRING string = "The quick brown fox jumps over the lazy dog."
	FIXVALUE  string = "e4d909c290d0fb1ca068ffaddf22cbd0"  
)
func setupTestBag(bagName string) (*bagins.Bag, error) {
	bag, err := bagins.NewBag(os.TempDir(), bagName, []string{"md5"}, false)
	if err != nil {
		return nil, err
	}
	return bag, nil
}
func setupCustomBag(bagName string) (*bagins.Bag, error) {
	bag, err := bagins.NewBag(os.TempDir(), bagName, []string{"md5", "sha256"}, true)
	if err != nil {
		return nil, err
	}
	bag.AddTagfile("bag-info.txt")
	bagInfo, _ := bag.TagFile("bag-info.txt")
	bagInfo.Data.SetFields([]bagins.TagField{
		*bagins.NewTagField("Source-Organization", "APTrust"),
		*bagins.NewTagField("Bagging-Date", "2016-06-01"),
		*bagins.NewTagField("Bag-Count", "1"),
		*bagins.NewTagField("Internal-Sender-Description", "This is a test bag with no content."),
		*bagins.NewTagField("Internal-Sender-Identification", "Bag XYZ"),
	})
	bag.AddTagfile("aptrust-info.txt")
	aptrustInfo, _ := bag.TagFile("aptrust-info.txt")
	aptrustInfo.Data.SetFields([]bagins.TagField{
		*bagins.NewTagField("Title", "APTrust Generic Test Bag"),
		*bagins.NewTagField("Rights", "Consortia"),
	})
	errors := bag.Save()
	if errors != nil && len(errors) > 0 {
		return nil, errors[0]
	}
	return bag, nil
}