dmarkham / enumer

A Go tool to auto generate methods for your enums
Other
411 stars 63 forks source link

Use constant names, Help the compiler detect value changes #30

Closed dmarkham closed 4 years ago

dmarkham commented 4 years ago

After reading https://github.com/dominikh/go-tools/issues/660 and https://github.com/alvaroloes/enumer/issues/59

I Like the ideas and have put together something that address the issues.

codecov-io commented 4 years ago

Codecov Report

Merging #30 into master will increase coverage by 0.92%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #30      +/-   ##
==========================================
+ Coverage   65.21%   66.14%   +0.92%     
==========================================
  Files           3        3              
  Lines         437      449      +12     
==========================================
+ Hits          285      297      +12     
  Misses        140      140              
  Partials       12       12
Impacted Files Coverage Δ
enumer.go 100% <100%> (ø) :arrow_up:
stringer.go 61.22% <100%> (+1.22%) :arrow_up:

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 56342fd...8d7221c. Read the comment docs.

dmarkham commented 4 years ago

@domsekotill I used your suggestion to build in the compile time check, I did not need to modify it that much to get it passing all the tests. Very slick idea :+1: