mirror of
https://github.com/vbatts/tar-split.git
synced 2024-11-16 13:28:37 +00:00
Vincent Batts
a63f83d94d
Perhaps this is not completely ideal, because it brings in cgo. And with the flags, it can have tailored experience. I've added a basic test to ensure that the cases we're interested in are covered. This does not yet integrate the usage of Vis()/Unviz() into the manifest create and compare. Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
15 lines
262 B
Go
15 lines
262 B
Go
package mtree
|
|
|
|
// #include "vis.h"
|
|
import "C"
|
|
import "fmt"
|
|
|
|
func Unvis(str string) (string, error) {
|
|
dst := new(C.char)
|
|
ret := C.strunvis(dst, C.CString(str))
|
|
if ret == 0 {
|
|
return "", fmt.Errorf("failed to encode string")
|
|
}
|
|
|
|
return C.GoString(dst), nil
|
|
}
|