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
|
@ -16,7 +16,8 @@ func (dh DirectoryHierarchy) WriteTo(w io.Writer) (n int64, err error) {
|
|||
sort.Sort(byPos(dh.Entries))
|
||||
var sum int64
|
||||
for _, e := range dh.Entries {
|
||||
i, err := io.WriteString(w, e.String()+"\n")
|
||||
str := e.String()
|
||||
i, err := io.WriteString(w, str+"\n")
|
||||
if err != nil {
|
||||
return sum, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue