feature: implement dynamic parameter resolution and add utility functions for random data generation - #9
Merged
Merged
Conversation
…ions for random data generation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements dynamic parameter resolution and adds comprehensive utility functions for random data generation. The changes reorganize the parameter resolution functionality into a dedicated params package and add extensive testing coverage with support for nested parameter resolution.
- Refactors parameter resolution code from
commontoparamspackage - Implements nested parameter resolution with cycle detection and depth limits
- Adds comprehensive utility functions for encoding, math operations, text processing, color generation, fake data, and time calculations
Reviewed Changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/configure/config.go | Updates import path to use new params package |
| internal/checker/endpoints.go | Updates import path to use new params package |
| internal/common/params/params.go | Core parameter resolution logic with nested support and cycle detection |
| internal/common/params/handlers.go | Handler functions for various parameter types (encoding, math, text, etc.) |
| internal/common/params/constants.go | Constants and data arrays for parameter generation |
| internal/common/params/file_loader.go | File loading utilities for fake data generation |
| internal/common/params/params_test.go | Comprehensive test suite covering all parameter types |
| internal/common/params/data/*.txt | Data files for generating realistic fake names, domains, and user agents |
| README.md, README_CN.md | Documentation updates describing new parameter features |
| Makefile | Adds test target for running tests |
Comments suppressed due to low confidence (1)
internal/common/params/file_loader.go:1
- Variable name 'adders' should be 'addrs' (short for addresses) to follow conventional naming.
package params
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Comment on lines
+72
to
+77
| adders, err := net.InterfaceAddrs() | ||
| if err != nil { | ||
| return "" | ||
| } | ||
|
|
||
| for _, addr := range adders { |
There was a problem hiding this comment.
Variable name 'adders' should be 'addrs' (short for addresses) to follow conventional naming.
Suggested change
| adders, err := net.InterfaceAddrs() | |
| if err != nil { | |
| return "" | |
| } | |
| for _, addr := range adders { | |
| addrs, err := net.InterfaceAddrs() | |
| if err != nil { | |
| return "" | |
| } | |
| for _, addr := range addrs { |
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.
Description
Fixes #6
Type of change
Please delete options that are not relevant.
Checklist