Apply PR #110's Read index doc comment fix to v1 templates#205
Apply PR #110's Read index doc comment fix to v1 templates#205TakumaKurosawa 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. |
|
@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
|
Friendly ping 🙏 @kazegusuri @sinmetal This is a small, comment-only change that backports your #110 fix to the v1 templates (the The diff is the same one-word change as #110, with Would any maintainer have a moment to take a look? Happy to address any feedback, and I can run |
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.