Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
jacobsa-fuse
Commits
f4d8f981
Commit
f4d8f981
authored
Jul 24, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MountConfig.toOptionsString
parent
440c9ee7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
mount_config.go
mount_config.go
+22
-1
No files found.
mount_config.go
View file @
f4d8f981
...
...
@@ -15,8 +15,10 @@
package
fuse
import
(
"fmt"
"log"
"runtime"
"strings"
"golang.org/x/net/context"
)
...
...
@@ -126,7 +128,26 @@ func (c *MountConfig) toMap() (opts map[string]string) {
return
}
func
escapeOptionsKey
(
s
string
)
(
res
string
)
{
res
=
s
res
=
strings
.
Replace
(
res
,
`\`
,
`\\`
,
-
1
)
res
=
strings
.
Replace
(
res
,
`,`
,
`\,`
,
-
1
)
return
}
// Create an options string suitable for passing to the mount helper.
func
(
c
*
MountConfig
)
toOptionsString
()
string
{
panic
(
"TODO"
)
var
components
[]
string
for
k
,
v
:=
range
c
.
toMap
()
{
k
=
escapeOptionsKey
(
k
)
component
:=
k
if
v
!=
""
{
component
=
fmt
.
Sprintf
(
"%s=%s"
,
k
,
v
)
}
components
=
append
(
components
,
component
)
}
return
strings
.
Join
(
components
,
","
)
}
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