package repolist import ( "strings" "go.wit.com/log" ) func RemoveFirstElement(slice []string) (string, []string) { if len(slice) == 0 { return "", slice // Return the original slice if it's empty } return slice[0], slice[1:] // Return the slice without the first element } // returns path, master branch name, devel branch name, user branch name func splitLine(line string) (string, string, string, string) { var path, master, devel, user string parts := strings.Split(line, " ") path, parts = RemoveFirstElement(parts) master, parts = RemoveFirstElement(parts) devel, parts = RemoveFirstElement(parts) user, parts = RemoveFirstElement(parts) // path, master, devel, user := strings.Split(line, " ") return path, master, devel, user } func RepoType() { for _, repo := range me.allrepos { switch repo.Status.RepoType() { case "binary": //log.Info("compile here. Show()") repo.Show() case "library": //log.Info("library here. Hide()") repo.Hide() default: log.Info("showApps() unknown. Show()") repo.Hide() } } } /* func myrepolist() []string { homeDir, _ := os.UserHomeDir() cfgfile := filepath.Join(homeDir, ".config/autotypist") content, _ := ioutil.ReadFile(cfgfile) out := string(content) out = strings.TrimSpace(out) lines := strings.Split(out, "\n") return lines } */