Skip to content

Commit 0c57626

Browse files
authored
chore(internal/config): readable property order (#3315)
1 parent cbd42a6 commit 0c57626

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

internal/config/config.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,16 @@ type Default struct {
144144

145145
// Library represents a library configuration.
146146
type Library struct {
147+
// Note: Properties should typically be added in alphabetical order, but
148+
// because this order impacts YAML serialization, we keep Name and Version
149+
// at the top for ease of consumption in file-form.
150+
151+
// Name is the library name, such as "secretmanager" or "storage".
152+
Name string `yaml:"name"`
153+
154+
// Version is the library version.
155+
Version string `yaml:"version,omitempty"`
156+
147157
// Channel specifies which googleapis Channel to generate from (for generated
148158
// libraries).
149159
Channels []*Channel `yaml:"channels,omitempty"`
@@ -160,10 +170,6 @@ type Library struct {
160170
// Keep lists files and directories to preserve during regeneration.
161171
Keep []string `yaml:"keep,omitempty"`
162172

163-
// Name is the library name, such as "secretmanager" or "storage". It is
164-
// listed first so it appears at the top of each library entry in YAML.
165-
Name string `yaml:"name"`
166-
167173
// Output is the directory where code is written. This overrides
168174
// Default.Output.
169175
Output string `yaml:"output,omitempty"`
@@ -203,9 +209,6 @@ type Library struct {
203209
// configuration (e.g., rust.modules) instead of generating a complete crate
204210
// from channels.
205211
Veneer bool `yaml:"veneer,omitempty"`
206-
207-
// Version is the library version.
208-
Version string `yaml:"version,omitempty"`
209212
}
210213

211214
// Channel describes a Channel to include in a library.

0 commit comments

Comments
 (0)