Skip to content

feature: implement dynamic parameter resolution and add utility functions for random data generation - #9

Merged
WCY-dt merged 1 commit into
mainfrom
feature/special_param
Sep 24, 2025
Merged

feature: implement dynamic parameter resolution and add utility functions for random data generation#9
WCY-dt merged 1 commit into
mainfrom
feature/special_param

Conversation

@WCY-dt

@WCY-dt WCY-dt commented Sep 24, 2025

Copy link
Copy Markdown
Member

Description

  • implement dynamic parameter resolution and add utility functions for random data generation

Fixes #6

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

@WCY-dt
WCY-dt requested a review from Copilot September 24, 2025 16:15
@WCY-dt WCY-dt added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 24, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 common to params package
  • 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 {

Copilot AI Sep 24, 2025

Copy link

Choose a reason for hiding this comment

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

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 {

Copilot uses AI. Check for mistakes.
@WCY-dt
WCY-dt merged commit bd20c59 into main Sep 24, 2025
4 checks passed
@WCY-dt
WCY-dt deleted the feature/special_param branch September 25, 2025 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

支持动态 url

2 participants