file type: add stringer

This commit was moved from ipfs/interface-go-ipfs-core@4e99a8e925

This commit was moved from ipfs/boxo@ee697a3b09
This commit is contained in:
Steven Allen 2019-03-05 09:36:58 -08:00
parent 987a46a697
commit 483caf76fd

View File

@ -30,6 +30,21 @@ const (
TSymlink
)
func (t FileType) String() string {
switch t {
case TUnknown:
return "unknown"
case TFile:
return "file"
case TDirectory:
return "directory"
case TSymlink:
return "symlink"
default:
return "<unknown file type>"
}
}
// DirEntry is a directory entry returned by `Ls`.
type DirEntry struct {
Name string