Add sortable ServiceMethods for template use with requisite unit tests #534
+36
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is Changing?
Functionally nothing changes to existing setups. The changes I've implemented are meant to be entirely optional and access is provided through a function that can be called within the
.tmpl
files. Currently the Order Guarantee provides alphabetical access for a majority of the information available in a proto file but Service Methods can only be accessed infile-order
. Service Methods can now optionally be fed through the SortServiceMethods function to get back an alphabetical listing.How is it Changing?
No unorthodox implementation details were had to my knowledge. I wanted to provide the usage without modifying the default implementation so it was added as a function call. Beyond that, the needed parts are modeled after what is already there for Messages, Enums, etc...
What Could Go Wrong?
This is being tested through use in a personal project as well the added unit test in
template_test.go
In my opinion, there is no available risk in adding this as the default usage remains untouched and this simply adds some extra functionality which mirrors existing items.