Skip to content

Conversation

fredbi
Copy link
Contributor

@fredbi fredbi commented Feb 7, 2021

enhancement: added enum pointer factory to codegen

Makes enum values more tractable when used in models which use pointers.

Signed-off-by: Frederic BIDON fredbi@yahoo.com

@fredbi fredbi changed the title Fix 2482 enhancement: added enum pointer factory to codegen Feb 7, 2021
Makes enum values more tractable when used in models which use pointers.

* generates a New{EnumType}(value {EnumType}) *{EnumType} function
* only support string enums (the only type for which we generate enum const atm)

* fixes go-swagger#2482

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
@codecov
Copy link

codecov bot commented Feb 8, 2021

Codecov Report

Merging #2514 (a3018cd) into master (d1a3446) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2514   +/-   ##
=======================================
  Coverage   81.92%   81.92%           
=======================================
  Files          53       53           
  Lines        8376     8376           
=======================================
  Hits         6862     6862           
  Misses       1022     1022           
  Partials      492      492           

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 d1a3446...a3018cd. Read the comment docs.

@fredbi fredbi merged commit f5667eb into go-swagger:master Feb 8, 2021
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.

Pointer convertors for enum types are not generated.
1 participant