Exemplo n.º 1
0
func listProblems(w io.Writer) {
	grzpath := eval.RootList()
	for _, root := range grzpath {
		filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
			if ok, _, _ := eval.IsProblem(path); ok {
				if _, rel, err := eval.SplitRootRelative(path, path); err == nil {
					fmt.Fprintf(w, "%s\n", eval.IdFromDir(rel))
				}
			}
			return nil
		})
	}
}
Exemplo n.º 2
0
func _addupdaterecursive(dir string) {
	if eval.GrzPath == "" {
		fmt.Printf("No roots.\n")
		return
	}
	filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
		if ok, _, _ := eval.IsProblem(path); ok {
			if _, rel, err := eval.SplitRootRelative(path, path); err == nil {
				e := _addupdate(path)
				if e != nil {
					fmt.Printf("Error: %s\n", e)
				} else {
					fmt.Printf("%s\n", eval.IdFromDir(rel))
				}
			} else {
				fmt.Printf("Error: %s\n", err)
			}
		}
		return nil
	})
}