func listTags(files []os.FileInfo, args []string) { hasTag := func(tags []string, tag string) bool { for _, candidate := range tags { if candidate == tag { return true } } return false } b := bugs.Bug{} for idx, _ := range files { b.LoadBug(bugs.Directory(bugs.GetRootDir() + "/issues/" + bugs.Directory(files[idx].Name()))) tags := b.StringTags() for _, tag := range args { if hasTag(tags, tag) { fmt.Printf("Issue %d: %s (%s)\n", idx+1, b.Title, strings.Join(tags, ", ")) } } } }