Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed extra space #2282

Merged
merged 1 commit into from
Feb 3, 2016
Merged

Removed extra space #2282

merged 1 commit into from
Feb 3, 2016

Conversation

RichardLitt
Copy link
Member

This was coming up as an extra space. For instance:

$ curl -i http://localhost:5001/api/v0/config?arg=kitten
//"Message": "Failed to get config value:  key has no attributes",

Removing it here.

License: MIT
Signed-off-by: Richard Littauer [email protected]

@rht
Copy link
Contributor

rht commented Feb 2, 2016

The space should still be there. The underlying issue is in the err being formatted in https://github.com/ipfs/go-ipfs/blob/585ef2b957beeb40175a18309aaa9e138f5774f2/repo/common/common.go#L24 (it should be e.g. if len(sofar) == 0 then print a different err message).

@whyrusleeping
Copy link
Member

agreed with @rht, we could either special case it, or use %q in the error format string so that theres an empty set of quotes there in this case

@RichardLitt
Copy link
Member Author

I think %q makes the most sense.

This was coming up as an extra space. For instance:

```curl -i http://localhost:5001/api/v0/config?arg=kitten
//"Message": "Failed to get config value:  key has no attributes",
```

Removing it here.

License: MIT
Signed-off-by: Richard Littauer <[email protected]>
@rht
Copy link
Contributor

rht commented Feb 2, 2016

The err message would still be " key has no attributes", while it could be clearer if it is stated as "root key has no attributes" or something.

@rht
Copy link
Contributor

rht commented Feb 2, 2016

I tried loading the config file in node, but:

$cp config config.json
$node
> var config = require('./config')
> config.kitten

(no err message. though this is also the case with golang's map)

@whyrusleeping
Copy link
Member

Cool, this works for me for now

whyrusleeping added a commit that referenced this pull request Feb 3, 2016
@whyrusleeping whyrusleeping merged commit e8c753d into master Feb 3, 2016
@whyrusleeping whyrusleeping deleted the docs/remove-extra-space branch February 3, 2016 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants