Revert "feat(internal/librarian/golang): restructure Go configuration in librarian.yaml"#5990
Conversation
… in libr…" This reverts commit aee112c.
There was a problem hiding this comment.
Code Review
This pull request refactors the configuration schema by moving Go-specific API configurations from the individual API structs to a centralized GoAPIs list within the GoModule struct. This change improves the organization of Go-specific settings and simplifies configuration management. The reviewer correctly identified a potential issue regarding shallow copies of the GoAPI struct when generating preview configurations, which could lead to unintended side effects if slice fields are modified in the future. No comments were removed as the provided feedback is actionable and addresses a potential bug.
| if shared { | ||
| // Make a copy so that we can mutate it. | ||
| pga := *sg | ||
| pga := *g |
There was a problem hiding this comment.
The GoAPI struct contains slice fields (EnabledGeneratorFeatures, NestedProtos). Performing a shallow copy of the struct here means the preview configuration will share the same underlying arrays as the stable configuration. While currently only the boolean NoSnippets field is mutated, this is a potential source of bugs if slice fields are ever modified for preview variants. Consider performing a deep copy or explicitly copying the slice fields if they need to be independent.
Reverts #5975
Fixes #5987