pingcap / failpoint

An implementation of failpoints for Golang.
Apache License 2.0
817 stars 63 forks source link

code: implement InjectContext marker function #5

Closed lonng closed 5 years ago

lonng commented 5 years ago

Signed-off-by: Lonng chris@lonng.org

What problem does this PR solve?

failpoint.Inject is the only way to inject a closure as a failpoint to out program in the before implementation, which drawback is the context parameter name has some limit and can not use compiler check in the regular mode.

What is changed and how it works?

Add a new failpoint.InjectContext marker function to fix this.

Check List

Tests

Side effects

N/A

Related changes

N/A

codecov[bot] commented 5 years ago

Codecov Report

Merging #5 into master will decrease coverage by 0.3345%. The diff coverage is 72.3684%.

@@               Coverage Diff                @@
##             master         #5        +/-   ##
================================================
- Coverage   54.8684%   54.5338%   -0.3346%     
================================================
  Files             8          8                
  Lines           760        783        +23     
================================================
+ Hits            417        427        +10     
- Misses          265        273         +8     
- Partials         78         83         +5
lonng commented 5 years ago

PTAL @winkyao @tiancaiamao