@cryptotaxi247 / kubo / commits / 30b344a5a

switch symlink target type to string

(path can't represent relative paths) This commit was moved from ipfs/interface-go-ipfs-core@368881fa4a30814112d1b2096c37c91f5fd16976 This commit was moved from ipfs/boxo@e2900773a64d532ccbbabd5ed23c048270bfbefe

Steven Allen committed Mar 5, 2019 at 09:54 UTC 30b344a5af44bae2c7606e18126f0cf66f73915e
2 files changed +4 -4
core/coreiface/tests/unixfs.go
+3 -3
@@ -782,12 +782,12 @@ func (tp *provider) TestLs(t *testing.T) {
782 if entry.Name != "name-of-symlink" {
783 t.Errorf("expected name = name-of-symlink, got %s", entry.Name)
784 }
785 - if entry.Target.String() != "/foo/bar" {
785 + if entry.Target != "/foo/bar" {
786 t.Errorf("expected symlink target to be /foo/bar, got %s", entry.Target)
787 }
788
789 - if int(entry.Size) != len(entry.Target.String()) {
790 - t.Errorf("expected size = %d, got %d", len(entry.Target.String()), entry.Size)
789 + if int(entry.Size) != len(entry.Target) {
790 + t.Errorf("expected size = %d, got %d", len(entry.Target), entry.Size)
791 }
792 if l, ok := <-entries; ok {
793 t.Errorf("didn't expect a second link")
core/coreiface/unixfs.go
+1 -1
@@ -53,7 +53,7 @@ type DirEntry struct {
53 // Only filled when asked to resolve the directory entry.
54 Size uint64 // The size of the file in bytes (or the size of the symlink).
55 Type FileType // The type of the file.
56 - Target Path // The symlink target (if a symlink).
56 + Target string // The symlink target (if a symlink).
57
58 Err error
59 }