Apply PR #110's Read index doc comment fix to v1 templates#205
Open
TakumaKurosawa wants to merge 1 commit into
Open
Apply PR #110's Read index doc comment fix to v1 templates#205TakumaKurosawa wants to merge 1 commit into
TakumaKurosawa wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Author
|
@googlebot I signed it! |
…templates PR cloudspannerecosystem#110 fixed the misleading "Generated from unique index" comment on ReadXxx for the v2 templates. The same issue still exists in the v1 templates/index.go.tpl. Apply the same one-word change so users of the v1 codegen also get accurate doc comments.
b4bc7e7 to
ca14be3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The v1
templates/index.go.tplhardcodes the doc comment on every generatedRead{{ .FuncName }}as// Generated from unique index '...'., even when the underlying index is not unique. As a result, downstream users of the v1 generator see misleading doc comments on non-unique-indexReadXxxfunctions.This is the same issue that was fixed for the v2 templates in #110 (merged 2022-12-07). That fix has not been backported to the v1 templates, and the v1 series is still being actively released (v0.8.0 and v0.8.1 in January 2026), so it remains worth fixing for v1 users.
Change
Mirror #110 exactly — drop the word
uniquefrom theRead{{ .FuncName }}doc comment so it reads// Generated from index '...'.regardless of uniqueness:tplbin/templates.goandtest/testmodels/**/*.yo.goare regenerated viamake regenandmake testdata-from-ddlto reflect the template change.Scope
templates/index.go.tpl,tplbin/templates.go, and regeneratedtest/testmodels/**/*.yo.go.v2/tree is untouched (already fixed by Fix typo in index.go.tpl #110).Test plan
make regen(rebuild embedded templates)go buildmake testdata-from-ddl(regenerate v1 test models from DDL)go vet ./...cleangofmt -lcleanmake testwas not run locally because it requires a running Spanner emulator and the diff is comment-only with no runtime behavior change. Happy to run it via the Spanner emulator if a reviewer would like to confirm.