Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
interface-go-dms3-core
Commits
368881fa
Commit
368881fa
authored
Mar 05, 2019
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch symlink target type to string
(path can't represent relative paths)
parent
5c6a7519
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
tests/unixfs.go
tests/unixfs.go
+3
-3
unixfs.go
unixfs.go
+1
-1
No files found.
tests/unixfs.go
View file @
368881fa
...
...
@@ -782,12 +782,12 @@ func (tp *provider) TestLs(t *testing.T) {
if entry.Name != "name-of-symlink" {
t.Errorf("expected name = name-of-symlink, got %s", entry.Name)
}
if entry.Target
.String()
!= "/foo/bar" {
if entry.Target != "/foo/bar" {
t.Errorf("expected symlink target to be /foo/bar, got %s", entry.Target)
}
if int(entry.Size) != len(entry.Target
.String()
) {
t.Errorf("expected size = %d, got %d", len(entry.Target
.String()
), entry.Size)
if int(entry.Size) != len(entry.Target) {
t.Errorf("expected size = %d, got %d", len(entry.Target), entry.Size)
}
if l, ok := <-entries; ok {
t.Errorf("didn't expect a second link")
...
...
unixfs.go
View file @
368881fa
...
...
@@ -53,7 +53,7 @@ type DirEntry struct {
// Only filled when asked to resolve the directory entry.
Size
uint64
// The size of the file in bytes (or the size of the symlink).
Type
FileType
// The type of the file.
Target
Path
// The symlink target (if a symlink).
Target
string
// The symlink target (if a symlink).
Err
error
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment