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

Update Result.String implementation to work as declared in interface #583

Merged
merged 2 commits into from
Jan 22, 2020

Conversation

jellonek
Copy link
Member

@jellonek jellonek commented Aug 27, 2018

String() of Result declared in pkg/types/types.go should return a Result
representation in JSON, instead of custom formatted string, which
additionally is not in the same form as described in docstring, which also e.g. is missing Routes part.

This PR changes this behavior to be consistent with behavior documented in the interface.

As String() interface does not have any place for errors - if there
would be any - instead of JSON value output will be an empty string.

Closes #581

edit/update:
As discussed in comments - this PR removes funcs which are turning Result to string.

@rosenhouse
Copy link
Contributor

Can we just delete this method? How are people using this method today?

@jellonek
Copy link
Member Author

It's probably used only for debugging purpose, but removal will be breaking change. At least it would require a note in release notes.

@andrey-ko
Copy link
Contributor

Probably types020.Result also should be updated for consistency:

func (r *Result) String() string {

@dcbw
Copy link
Member

dcbw commented Aug 21, 2019

I vote for just removing the function entirely.

@jellonek
Copy link
Member Author

+1
Ok. So I'll update PR with removal of this func and update in Spec.

@jellonek jellonek self-assigned this Aug 21, 2019
Closes containernetworking#581

Signed-off-by: Piotr Skamruk <piotr.skamruk@gmail.com>
Signed-off-by: Piotr Skamruk <piotr.skamruk@gmail.com>
@jellonek
Copy link
Member Author

Bump. Funcs removed.
Please remember that it is a possibly breaking change, while we are not aware if anyone was using that.
Quick look on output of git grep "\\bString" in plugins repository doesn't show any uses of that in our code.

Copy link
Contributor

@bboreham bboreham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
It's a breaking change; I guess will trigger 0.8.0 when we release.

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.

Inconsistent Result documentation
5 participants