Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
interfaces/builtin: distribute code of touching allInterfaces #3291
Conversation
| // Interfaces returns all of the built-in interfaces. | ||
| func Interfaces() []interfaces.Interface { | ||
| + if !sorted { | ||
| + sort.Sort(byIfaceName(allInterfaces)) |
zyga
May 10, 2017
Contributor
We don't care about sorting at all but I wanted to ensure that it's not changing this property. The old list used to be sorted so this one can be as well.
| + | ||
| +// registerIface appends the given interface into the list of all known interfaces. | ||
| +func registerIface(iface interfaces.Interface) { | ||
| + allInterfaces = append(allInterfaces, iface) |
mvo5
May 10, 2017
Collaborator
Should we care about duplication here? I.e. do not allow to register an interface twice?
zyga
May 10, 2017
Contributor
Yes, I was thinking about it as well. Doing this branch has uncovered a number of smaller things that ought to be improved and I'm already preparing another one (and I have ideas for two more).
zyga
added some commits
May 10, 2017
chipaca
merged commit 90736a5
into
snapcore:master
May 10, 2017
7 checks passed
artful-amd64
autopkgtest finished (success)
Details
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
xenial-amd64
autopkgtest finished (success)
Details
xenial-i386
autopkgtest finished (success)
Details
xenial-ppc64el
autopkgtest finished (success)
Details
yakkety-amd64
autopkgtest finished (success)
Details
zesty-amd64
autopkgtest finished (success)
Details
zyga
deleted the
zyga:tweak/less-conflicts-around-all-go
branch
May 10, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
zyga commentedMay 10, 2017
This patch moves code that registers an interface in allInterfaces, as
well as the code that ensures a given interface is registered into the
modules related to the actual interface. This should lessen the
conflicts around adding a new interface and simplify the task
conceptually.
The only remaining centralized elements are base declaration entries
(per jdstrand's request) and the list of implicit interfaces (which
could be merged into interfaces easily later).
Signed-off-by: Zygmunt Krynicki zygmunt.krynicki@canonical.com