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
juju/names refactor part 2 #3
juju/names refactor part 2 #3
Conversation
Prepare to alter the signature for ParseTag to return (Tag, error)
Prepare to alter the signature for ParseTag to return (Tag, error)
…heney/names into 104-introduce-tags-type-ii
In passing, why not just "type EnvironTag string" (and the others) ? |
On Wed, Jun 11, 2014 at 6:10 PM, rogpeppe notifications@github.com wrote:
The major one was when I started I wasn't sure what kind of data each type The minor concern was to prevent people converting back to a string, by
|
I do have to admit to preferring the struct approach as it actually names the string, like uuid for environment. I've also been thinking in passing that a RemoteUserTag may well have two parts: username and identity provider (username@identity-provider) |
@@ -148,7 +148,7 @@ func (*tagSuite) TestParseTag(c *gc.C) { | |||
kind, id, err := names.ParseTag(test.tag, test.expectKind) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since the result of the ParseTag function has changed I think
tag, id, err
would be better variable names.
Then kind.Kind() becomes tag.Kind() below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
LGTM, we can refactor the tests later. |
Thanks. The very next branch refactors the test. This is just an interrum On Thu, Jun 12, 2014 at 2:51 PM, Tim Penhey notifications@github.com
|
Introduce tag.Id() and tag.Kind() methods.
Prepare to alter the signature for ParseTag to return (Tag, error)