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
go-unixfs
Commits
639d196a
Commit
639d196a
authored
10 years ago
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
linted config
parent
80323eba
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
10 deletions
+13
-10
cmd/ipfs/config.go
cmd/ipfs/config.go
+6
-3
cmd/ipfs/ipfs.go
cmd/ipfs/ipfs.go
+1
-1
config/config.go
config/config.go
+5
-5
config/config_test.go
config/config_test.go
+1
-1
No files found.
cmd/ipfs/config.go
View file @
639d196a
...
...
@@ -45,7 +45,7 @@ func init() {
func
configCmd
(
c
*
commander
.
Command
,
inp
[]
string
)
error
{
// todo: implement --config filename flag.
filename
,
err
:=
config
.
Config
Filename
(
""
)
filename
,
err
:=
config
.
Filename
(
""
)
if
err
!=
nil
{
return
err
}
...
...
@@ -103,8 +103,11 @@ func configCat(filename string) error {
}
defer
file
.
Close
()
_
,
err
=
io
.
Copy
(
os
.
Stdout
,
file
)
return
err
if
_
,
err
=
io
.
Copy
(
os
.
Stdout
,
file
);
err
!=
nil
{
return
err
}
u
.
POut
(
"
\n
"
)
return
nil
}
func
configEditor
(
filename
string
)
error
{
...
...
This diff is collapsed.
Click to expand it.
cmd/ipfs/ipfs.go
View file @
639d196a
...
...
@@ -67,7 +67,7 @@ func main() {
func
localNode
()
(
*
core
.
IpfsNode
,
error
)
{
//todo implement config file flag
cfg
,
err
:=
config
.
Config
Load
(
""
)
cfg
,
err
:=
config
.
Load
(
""
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
This diff is collapsed.
Click to expand it.
config/config.go
View file @
639d196a
...
...
@@ -32,8 +32,8 @@ var defaultConfigFile = `{
}
`
//
Config
Filename returns the proper tilde expanded config filename.
func
Config
Filename
(
filename
string
)
(
string
,
error
)
{
// Filename returns the proper tilde expanded config filename.
func
Filename
(
filename
string
)
(
string
,
error
)
{
if
len
(
filename
)
==
0
{
filename
=
defaultConfigFilePath
}
...
...
@@ -42,9 +42,9 @@ func ConfigFilename(filename string) (string, error) {
return
u
.
TildeExpansion
(
filename
)
}
//
Config
Load reads given file and returns the read config, or error.
func
Config
Load
(
filename
string
)
(
*
Config
,
error
)
{
filename
,
err
:=
Config
Filename
(
filename
)
// Load reads given file and returns the read config, or error.
func
Load
(
filename
string
)
(
*
Config
,
error
)
{
filename
,
err
:=
Filename
(
filename
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
This diff is collapsed.
Click to expand it.
config/config_test.go
View file @
639d196a
...
...
@@ -7,7 +7,7 @@ import (
func
TestConfig
(
t
*
testing
.
T
)
{
cfg
,
err
:=
Config
Load
(
""
)
cfg
,
err
:=
Load
(
""
)
if
err
!=
nil
{
t
.
Error
(
err
)
return
...
...
This diff is collapsed.
Click to expand it.
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