Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Added ability to use external parameters and custom templates#90

Merged
cweill merged 13 commits intocweill:developfrom
frenzywang:master
May 20, 2019
Merged

Added ability to use external parameters and custom templates#90
cweill merged 13 commits intocweill:developfrom
frenzywang:master

Conversation

@frenzywang
Copy link
Contributor

@frenzywang frenzywang commented Feb 25, 2019

This diff is designed so that gotests can be called by other tools using a custom template to generate data other than the test function. Fixes #96.

Please help to review, thank you.

@coveralls
Copy link

coveralls commented Feb 27, 2019

Coverage Status

Coverage increased (+0.02%) to 96.376% when pulling 776ffe0 on a1305315624:master into afa0a37 on cweill:develop.

@cweill
Copy link
Owner

cweill commented Mar 1, 2019

@a1305315624, I'll try to have a look this weekend.

@cweill cweill changed the base branch from master to develop April 7, 2019 19:34
Copy link
Owner

@cweill cweill left a comment

Choose a reason for hiding this comment

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

@a1305315624: This mostly looks good to merge. Please see my comments.

@frenzywang
Copy link
Contributor Author

I'll fix it at night

Copy link
Owner

@cweill cweill left a comment

Choose a reason for hiding this comment

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

Looks good. Please resolve the comments, then we can merge.

@frenzywang
Copy link
Contributor Author

What do I need to do about merge code? that is my first pull request.

@cweill cweill merged commit f4738f4 into cweill:develop May 20, 2019
@cweill
Copy link
Owner

cweill commented May 20, 2019

Sorry about that. It's now merged to master.

cweill added a commit that referenced this pull request Jun 30, 2019
* Fix TravisCI and add go1.11 and go1.12 support (#94)

* Fix function comments based on best practices from Effective Go (#89)

Signed-off-by: CodeLingo Bot <[email protected]>

* Added ability to use external parameters and custom templates (#90)
@cweill cweill mentioned this pull request Feb 22, 2021
cweill added a commit that referenced this pull request Oct 21, 2025
Resolves #149

The -template_params flag was defined in main.go but never passed to
the process.Options struct, making it non-functional. This was a bug
introduced in PR #90.

Changes:
- Added TemplateParams field to process.Options struct
- Updated main.go to pass *templateParams to process.Run()
- Updated process.go to parse JSON from TemplateParams string
- File-based params (-template_params_file) take precedence over
  string-based params (-template_params) if both are provided
- Added proper error handling for invalid JSON

The flag now works as intended:
  $ gotests -template_params '{"key":"value"}' -all file.go

Thanks to @butuzov for identifying this issue and @cweill for the fix suggestion!

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow users to pass external parameters to custom templates

3 participants