package control import ( "flag" "os" "path/filepath" "regexp" "testing" ) var updatePlain = flag.Bool("update-plain", false, "rewrite testdata/plain from the current output") var plainStamp = regexp.MustCompile(`\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z| UTC)?`) // pinPlain compares a command's piped output with the copy taken before // its terminal screen was rewritten. Timestamps are masked, since // fixtures are created at test time. func pinPlain(t *testing.T, name, got string) { t.Helper() got = plainStamp.ReplaceAllString(got, "