这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@chrisguitarguy
Copy link
Contributor

Same as With(), but takes and int, calls PushIndex, converts to a string, then pops.

Found myself wishing for this functionality today, but not a deal breaker if it doesn't make it in. Just a little more convenient.

I did not see any tests for pathbuffer itself, but since this method wouldn't be covered elsewhere I added a test for it.

Same as `With()`, but takes and int, calls `PushIndex`, converts to a
string, then pops.
@danielgtaylor danielgtaylor requested a review from Copilot April 22, 2025 04:52
Copy link
Contributor

Copilot AI left a comment

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 introduces a new helper method, WithIndex, for PathBuffer to easily combine pushing an index into a buffer, converting it to a string, and popping the value.

  • Adds a WithIndex method in validate.go with accompanying inline documentation.
  • Includes a new test in validate_test.go to verify the expected string formatting with an index.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
validate_test.go Added test for WithIndex functionality
validate.go Introduced WithIndex method with documentation

@codecov
Copy link

codecov bot commented Apr 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.11%. Comparing base (58aba1e) to head (77c8ffd).
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #788   +/-   ##
=======================================
  Coverage   93.10%   93.11%           
=======================================
  Files          23       23           
  Lines        5296     5301    +5     
=======================================
+ Hits         4931     4936    +5     
  Misses        313      313           
  Partials       52       52           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@danielgtaylor danielgtaylor merged commit 43f7b42 into danielgtaylor:main Apr 22, 2025
5 checks passed
@danielgtaylor
Copy link
Owner

Thanks!

Sign up for free to 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.

2 participants