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

Skip to content

Conversation

@vearutop
Copy link
Member

No description provided.

IgorBaskakov and others added 30 commits June 25, 2021 08:49
Under Go 1.17+ the lines of the debug stack aren't guaranteed to
contain a period, notability a line can just read "panic".

This commit adds some defensive programming to ensure we don't
attempt to slice with a negative index and adds a very basic test
to catch the negative index panic without this change.
* some progress on styling

* backgroud fix on lightmode
pkieltyka and others added 8 commits January 3, 2022 13:57
This error is generally used to abort a request while streaming a response
so it should not be recovered otherwise the request is not aborted and
the client does not detect the error

Fixes go-chi#588
The company styles its name as Cloudflare since a few years.
# Conflicts:
#	.github/workflows/ci.yml
#	Makefile
#	README.md
#	_examples/todos-resource/users.go
#	middleware/realip.go
#	middleware/realip_test.go
#	middleware/recoverer.go
#	mux_test.go
@github-actions
Copy link

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 50 (+3) 5461 (+51) 3556 (+34) 1077 (+16) 828 (+1) 663 (+21) 145.1K (+1.8K)
Go (test) 18 (+1) 4040 (+57) 3192 (+47) 239 609 (+10) 573 (+16) 112.4K (+1.2K)
Markdown 5 1022 (+24) 768 (+12) 0 254 (+12) 0 44.8K (+864B)

@github-actions
Copy link

Go API Changes

# github.com/swaggest/fchi
## compatible changes
Error: added

# github.com/swaggest/fchi/middleware
## compatible changes
RedirectSlashes: added
StripSlashes: added

# summary
Inferred base version: v1.0.4
Suggested version: v1.1.0

@github-actions
Copy link

Benchmark Result

Benchmark diff with base branch
name                                        old time/op    new time/op    delta
Mux/route:/-2                                  175ns ± 4%     192ns ± 1%   +9.68%  (p=0.016 n=5+4)
Mux/route:/hi-2                                221ns ± 5%     258ns ± 7%  +16.87%  (p=0.008 n=5+5)
Mux/route:/sup/123/and/this-2                  712ns ± 5%     719ns ± 5%     ~     (p=0.690 n=5+5)
Mux/route:/sup/123/foo/this-2                 1.07µs ± 6%    1.13µs ± 3%     ~     (p=0.095 n=5+5)
Mux/route:/sharing/z/aBc-2                     188ns ±11%     179ns ± 9%     ~     (p=0.103 n=5+5)
Mux/route:/sharing/z/aBc/twitter-2             148ns ± 6%     138ns ± 1%   -6.89%  (p=0.016 n=5+5)
Mux/route:/sharing/z/aBc/direct-2              186ns ± 7%     174ns ± 1%   -6.42%  (p=0.008 n=5+5)
Mux/route:/sharing/z/aBc/direct/download-2     154ns ± 2%     147ns ± 3%   -4.71%  (p=0.016 n=5+5)
TreeGet-2                                      165ns ± 0%     155ns ± 7%   -6.02%  (p=0.008 n=5+5)

name                                        old alloc/op   new alloc/op   delta
Mux/route:/-2                                  88.2B ± 5%     93.8B ± 2%     ~     (p=0.063 n=5+4)
Mux/route:/hi-2                                91.0B ± 2%    100.2B ± 2%  +10.11%  (p=0.008 n=5+5)
Mux/route:/sup/123/and/this-2                   501B ± 2%      444B ± 1%  -11.21%  (p=0.016 n=5+4)
Mux/route:/sup/123/foo/this-2                   652B ± 0%      652B ± 0%     ~     (all equal)
Mux/route:/sharing/z/aBc-2                     92.6B ±14%     89.4B ±11%     ~     (p=0.198 n=5+5)
Mux/route:/sharing/z/aBc/twitter-2             99.0B ± 4%     96.6B ± 4%     ~     (p=0.206 n=5+5)
Mux/route:/sharing/z/aBc/direct-2              90.4B ±10%     88.6B ± 2%     ~     (p=0.635 n=5+5)
Mux/route:/sharing/z/aBc/direct/download-2      104B ± 4%       98B ± 4%   -5.20%  (p=0.024 n=5+5)
TreeGet-2                                      0.00B          0.00B          ~     (all equal)

name                                        old allocs/op  new allocs/op  delta
Mux/route:/-2                                   0.00           0.00          ~     (all equal)
Mux/route:/hi-2                                 1.00 ± 0%      1.00 ± 0%     ~     (all equal)
Mux/route:/sup/123/and/this-2                   1.00 ± 0%      1.00 ± 0%     ~     (all equal)
Mux/route:/sup/123/foo/this-2                   1.00 ± 0%      1.00 ± 0%     ~     (all equal)
Mux/route:/sharing/z/aBc-2                      0.00           0.00          ~     (all equal)
Mux/route:/sharing/z/aBc/twitter-2              0.00           0.00          ~     (all equal)
Mux/route:/sharing/z/aBc/direct-2               0.00           0.00          ~     (all equal)
Mux/route:/sharing/z/aBc/direct/download-2      0.00           0.00          ~     (all equal)
TreeGet-2                                       0.00           0.00          ~     (all equal)
Benchmark result
name                                        time/op
Mux/route:/-2                                192ns ± 1%
Mux/route:/hi-2                              258ns ± 7%
Mux/route:/sup/123/and/this-2                719ns ± 5%
Mux/route:/sup/123/foo/this-2               1.13µs ± 3%
Mux/route:/sharing/z/aBc-2                   179ns ± 9%
Mux/route:/sharing/z/aBc/twitter-2           138ns ± 1%
Mux/route:/sharing/z/aBc/direct-2            174ns ± 1%
Mux/route:/sharing/z/aBc/direct/download-2   147ns ± 3%
TreeGet-2                                    155ns ± 7%

name                                        alloc/op
Mux/route:/-2                                93.8B ± 2%
Mux/route:/hi-2                               100B ± 2%
Mux/route:/sup/123/and/this-2                 444B ± 1%
Mux/route:/sup/123/foo/this-2                 652B ± 0%
Mux/route:/sharing/z/aBc-2                   89.4B ±11%
Mux/route:/sharing/z/aBc/twitter-2           96.6B ± 4%
Mux/route:/sharing/z/aBc/direct-2            88.6B ± 2%
Mux/route:/sharing/z/aBc/direct/download-2   98.4B ± 4%
TreeGet-2                                    0.00B     

name                                        allocs/op
Mux/route:/-2                                 0.00     
Mux/route:/hi-2                               1.00 ± 0%
Mux/route:/sup/123/and/this-2                 1.00 ± 0%
Mux/route:/sup/123/foo/this-2                 1.00 ± 0%
Mux/route:/sharing/z/aBc-2                    0.00     
Mux/route:/sharing/z/aBc/twitter-2            0.00     
Mux/route:/sharing/z/aBc/direct-2             0.00     
Mux/route:/sharing/z/aBc/direct/download-2    0.00     
TreeGet-2                                     0.00     

@github-actions
Copy link

Unit Test Coverage

total: (statements) 76.9%
changed lines: (statements) 88.2%, coverage is less than 90.0%, consider testing the changes more thoroughly

Coverage of changed lines
File Function Coverage
Total 88.2%
context.go 100.0%
context.go:123 RoutePattern 100.0%
middleware/realip.go 88.9%
middleware/realip.go:46 realIP 66.7%
middleware/recoverer.go 85.0%
middleware/recoverer.go:26 Recoverer 100.0%
middleware/recoverer.go:50 PrintPrettyStack 100.0%
middleware/recoverer.go:65 parse 100.0%
middleware/recoverer.go:123 decorateFuncCallLine 41.7%
Coverage diff with base branch
File Function Base Coverage Current Coverage
Total 66.4% 76.9% (+10.5%)
github.com/swaggest/fchi/middleware/realip.go realIP 100.0% 92.3% (-7.7%)
github.com/swaggest/fchi/middleware/recoverer.go PrintPrettyStack 0.0% 83.3% (+83.3%)
github.com/swaggest/fchi/middleware/recoverer.go Recoverer 0.0% 100.0% (+100.0%)
github.com/swaggest/fchi/middleware/recoverer.go decorateFuncCallLine 0.0% 84.0% (+84.0%)
github.com/swaggest/fchi/middleware/recoverer.go decorateLine 0.0% 87.5% (+87.5%)
github.com/swaggest/fchi/middleware/recoverer.go decorateSourceLine 0.0% 96.2% (+96.2%)
github.com/swaggest/fchi/middleware/recoverer.go parse 0.0% 95.8% (+95.8%)
github.com/swaggest/fchi/middleware/terminal.go cW 0.0% 60.0% (+60.0%)

@codecov
Copy link

codecov bot commented Jun 19, 2022

Codecov Report

Merging #8 (3985c50) into master (3982cf5) will increase coverage by 9.24%.
The diff coverage is 68.18%.

@@            Coverage Diff             @@
##           master       #8      +/-   ##
==========================================
+ Coverage   62.77%   72.02%   +9.24%     
==========================================
  Files          17       17              
  Lines         900      908       +8     
==========================================
+ Hits          565      654      +89     
+ Misses        311      219      -92     
- Partials       24       35      +11     
Flag Coverage Δ
unittests 72.02% <68.18%> (+9.24%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mux.go 85.71% <ø> (ø)
middleware/realip.go 82.35% <50.00%> (-17.65%) ⬇️
middleware/recoverer.go 84.84% <66.66%> (+84.84%) ⬆️
context.go 93.93% <100.00%> (+0.60%) ⬆️
middleware/terminal.go 55.55% <0.00%> (+11.11%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@vearutop vearutop merged commit d04af46 into master Jun 19, 2022
@vearutop vearutop deleted the upd-upstream branch June 19, 2022 22:34
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.