modern-go / reflect2

reflect api without runtime reflect.Value cost
Apache License 2.0
758 stars 73 forks source link

Change reflect2 to rely on sync.Map (go 1.9+) rather than concurrent.Map #4

Closed artasparks closed 6 years ago

artasparks commented 6 years ago

Reduces dependencies of reflect2 and makes it cleaner to import.

Tested by importing gls,test,reflect2-tests and running the tests:

$ ./test.sh 
ok      github.com/modern-go/reflect2-tests     0.023s  coverage: 12.3% of statements in github.com/modern-go/reflect2
ok      github.com/modern-go/reflect2-tests/test15      0.024s  coverage: 6.0% of statements in github.com/modern-go/reflect2
ok      github.com/modern-go/reflect2-tests/tests       0.055s  coverage: 62.6% of statements in github.com/modern-go/reflect2
codecov-io commented 6 years ago

Codecov Report

Merging #4 into master will decrease coverage by 0.1%. The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #4      +/-   ##
==========================================
- Coverage   60.58%   60.48%   -0.11%     
==========================================
  Files          20       19       -1     
  Lines         751      749       -2     
==========================================
- Hits          455      453       -2     
  Misses        280      280              
  Partials       16       16
Impacted Files Coverage Δ
reflect2.go 65.04% <33.33%> (ø) :arrow_up:
go_below_19.go

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 94122c3...cc3ce5d. Read the comment docs.

taowen commented 6 years ago

we need to support version lower than 1.9