Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
client,cmd/snap: clarify name ambiguity in Plug or Slot #547
Conversation
|
Hmm.. that doesn't look like an improvement to me. The reasoning for using it at the API edge is to reinforce the terminology and make the data more obvious. Inside our own API, having Plug.Plug will likely not help much, comparing it to Plug.Name. |
niemeyer
added
the
Reviewed
label
Feb 29, 2016
zyga
closed this
Mar 1, 2016
|
I'm closing this temporarily. After discussing this online we agreed to use mixed json/go field naming. For Go we'll have Plug.Name and Slot.Name but in JSON we'll have {"plug": "..."} and {"slot": "..."} to differentiate the two fields. |
zyga
reopened this
Mar 1, 2016
zyga
changed the title from
client,cmd/snap: specialize Name to either Plug or Slot
to
client,cmd/snap: clarify name ambiguity in Plug or Slot
Mar 1, 2016
stevenwilkin
reviewed
Mar 1, 2016
| @@ -68,18 +68,18 @@ func (x *cmdInterfaces) Execute(args []string) error { | ||
| if x.Positionals.Query.Snap != "" && x.Positionals.Query.Snap != plug.Snap { | ||
| continue | ||
| } | ||
| - if x.Positionals.Query.Name != "" && x.Positionals.Query.Name != plug.Name { | ||
| + if x.Positionals.Query.Name != "" && x.Positionals.Query.Name != plug.Plug.Name { |
stevenwilkin
Mar 1, 2016
Member
Would connection.Plug.Name or similar make more sense here? I see that AllPlugs() returns []PlugConnections
zyga
Mar 1, 2016
Contributor
This is fixed with the upcoming /2.0/interfaces API change. It actually returns InterfaceConnections then but you'll have to wait a sec to see it.
|
|
zyga commentedFeb 29, 2016
This patch changes the public snappy API to refer to Plug.Name as .Plug
and Slot.Name as .Slot.
Signed-off-by: Zygmunt Krynicki zygmunt.krynicki@canonical.com