Skip to content

Conversation

@Hyuga-Tsukui
Copy link
Contributor

@Hyuga-TsukuiHyuga-Tsukui commented Oct 5, 2023

Attempt at adding the feature for #2012.

I am not a native English speaker, so some variable names might not be appropriate.

I've added a new build_tags option, which gets inserted into the template when enabled.

Fixes#2012

Copy link
Collaborator

@kyleconroykyleconroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Only one real change before we can merge this in. Appreciate you adding a test case.

Comment on lines 3 to 4
//go:build{{.BuildTags}}
// +build{{.BuildTags}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The // +build syntax has been deprecated since Go 1.17. Let's remove it and only support //go:build.

boolemit_result_struct_pointers=8;
boolemit_params_struct_pointers=9;
boolemit_methods_with_db_argument=10;
stringbuild_tags=29;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add this to the end of the message instead of in the middle?

@Hyuga-Tsukui
Copy link
ContributorAuthor

Thank you for the review. I've made the corrections, so please check again.

@kyleconroykyleconroy merged commit 7dc0e7c into sqlc-dev:mainOct 6, 2023
alfonsodev pushed a commit to ExponentiaTeam/sqlc that referenced this pull request Oct 13, 2025
…v#2807) * feat(codegen): add support for build tags (sqlc-dev#2012) * Update docs/reference/config.md * Update internal/codegen/golang/gen.go --------- Co-authored-by: Kyle Gray <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Being able to mark generated files with go:build tags

2 participants

@Hyuga-Tsukui@kyleconroy