Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
3d25175f
Commit
3d25175f
authored
Feb 14, 2019
by
Cristian Maglie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated go-paths-helper
parent
6145d748
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
Gopkg.lock
Gopkg.lock
+2
-2
vendor/github.com/arduino/go-paths-helper/paths.go
vendor/github.com/arduino/go-paths-helper/paths.go
+19
-0
No files found.
Gopkg.lock
View file @
3d25175f
...
...
@@ -30,11 +30,11 @@
[[projects]]
branch = "master"
digest = "1:
fd2ebfc02b6ad10599b226d2c0265f160e95e7c80e23f01dcf34a8aff0de98c9
"
digest = "1:
045d5ae3596598b9b9591042561fbcbf2d484d2a744fd007151cab3862a6b8f6
"
name = "github.com/arduino/go-paths-helper"
packages = ["."]
pruneopts = "UT"
revision = "
751652ddd9f0a98650e681673c2c73937002e889
"
revision = "
c3c98d1bf2e1069f60ab84bff3a2eb3c5422f3b0
"
[[projects]]
branch = "master"
...
...
vendor/github.com/arduino/go-paths-helper/paths.go
View file @
3d25175f
...
...
@@ -444,6 +444,25 @@ func (p *Path) EquivalentTo(other *Path) bool {
return
p
.
Clean
()
.
path
==
other
.
Clean
()
.
path
}
// Parents returns all the parents directories of the current path. If the path is absolute
// it starts from the current path to the root, if the path is relative is starts from the
// current path to the current directory.
// The path should be clean for this method to work properly (no .. or . or other shortcuts).
// This function does not performs any check on the returned paths.
func
(
p
*
Path
)
Parents
()
[]
*
Path
{
res
:=
[]
*
Path
{}
dir
:=
p
for
{
res
=
append
(
res
,
dir
)
parent
:=
dir
.
Parent
()
if
parent
.
EquivalentTo
(
dir
)
{
break
}
dir
=
parent
}
return
res
}
func
(
p
*
Path
)
String
()
string
{
return
p
.
path
}
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