mirror of
https://github.com/vbatts/go-mtree.git
synced 2025-06-27 04:28:30 +00:00
vis: refactored code to reflect using vis/unvis for file names
Added some more test cases for `vis`ing and `unvis`ing strings, and a test case that walks/checks a directory with filenames that require encoding. Had to change Path() to account for possible errors Unvis() could return. Refactored Vis()/Unvis() into go-mtree tar functionality as well. Signed-off-by: Stephen Chung <schung@redhat.com>
This commit is contained in:
parent
a63f83d94d
commit
773763fb87
12 changed files with 177 additions and 41 deletions
|
@ -202,13 +202,25 @@ func main() {
|
|||
if len(res.Extra) > 0 {
|
||||
defer os.Exit(1)
|
||||
for _, extra := range res.Extra {
|
||||
fmt.Printf("%s extra\n", extra.Path())
|
||||
extrapath, err := extra.Path()
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
isErr = true
|
||||
return
|
||||
}
|
||||
fmt.Printf("%s extra\n", extrapath)
|
||||
}
|
||||
}
|
||||
if len(res.Missing) > 0 {
|
||||
defer os.Exit(1)
|
||||
for _, missing := range res.Missing {
|
||||
fmt.Printf("%s missing\n", missing.Path())
|
||||
missingpath, err := missing.Path()
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
isErr = true
|
||||
return
|
||||
}
|
||||
fmt.Printf("%s missing\n", missingpath)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue