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

Refactor ParseTag #5

Merged
merged 6 commits into from Jun 16, 2014
Merged

Refactor ParseTag #5

merged 6 commits into from Jun 16, 2014

Conversation

davecheney
Copy link
Contributor

  • refactor ParseTag, removing the hint. The hint was only used by code when it expected a specific tag type.
  • introduce type specific Tag parsers, these replace all the uses of ParseTag with hint, and return a specific Tag implementation, not an interface.
  • Add unit tests for new methods

* refactor ParseTag, removing the hint. The hint was only used by code when it expected a specific tag type.
* introduce type specific Tag parsers, these replace all the uses of ParseTag with hint and return a specific Tag implementation, not an interface, so the Tag's implemenations values are available without calling a helper method
* Add unit tests for new methods
* refactor ParseTag, removing the hint. The hint was only used by code when it expected a specific tag type.
* introduce type specific Tag parsers, these replace all the uses of ParseTag with hint and return a specific Tag implementation, not an interface, so the Tag's implemenations values are available without calling a helper method
* Add unit tests for new methods
tag: "",
err: names.InvalidTagError("", ""),
}, {
tag: "machine-0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@howbazaar
Copy link
Contributor

Done.

@davecheney
Copy link
Contributor Author

PTAL. I tweaked the example, but that was all I changed.

@rogpeppe
Copy link
Contributor

If the Parse functions are going to return specific tag types, shouldn't the New* functions do likewise?

@davecheney
Copy link
Contributor Author

They can do that, I can address that in a followup branch.

On Mon, Jun 16, 2014 at 5:31 PM, rogpeppe notifications@github.com wrote:

If the Parse functions are going to return specific tag types, shouldn't
the New* functions do likewise?


Reply to this email directly or view it on GitHub
#5 (comment).

@howbazaar
Copy link
Contributor

LGTM

davecheney added a commit that referenced this pull request Jun 16, 2014
@davecheney davecheney merged commit 556cb42 into juju:master Jun 16, 2014
@davecheney davecheney deleted the 106-parsetag-refactor branch June 16, 2014 23:05
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.

None yet

3 participants