Skip to content

enhancement: Add .Pointer() method to enums. #2680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 25, 2021
Merged

enhancement: Add .Pointer() method to enums. #2680

merged 3 commits into from
Dec 25, 2021

Conversation

thetorpedodog
Copy link
Contributor

Following the example of protobuf generated code, this change creates
a .Pointer() method on enums that creates a new, non-aliased pointer
to an enum value.

This means that you can call:

enumPtr := SomeEnumConst.Pointer()

to get a pointer to an enum value.

For reference, see:
https://developers.google.com/protocol-buffers/docs/reference/go-generated#enum


I'm not sure what the best way to test this is; the way the existing test cases work is fairly opaque to me. Any pointers (heh)?

@casualjim
Copy link
Member

can you run go generate ./generator ?

@thetorpedodog
Copy link
Contributor Author

Done.

@thetorpedodog
Copy link
Contributor Author

Is there anything else I need to do here?

@casualjim
Copy link
Member

I fixed the build step on master, so if you update then the builds will hopefully pass

Following the example of protobuf generated code, this change creates
a `.Pointer()` method on enums that creates a new, non-aliased pointer
to an enum value.

This means that you can call:

    enumPtr := SomeEnumConst.Pointer()

to get a pointer to an enum value.

For reference, see:
https://developers.google.com/protocol-buffers/docs/reference/go-generated#enum

Signed-off-by: Paul Fisher <paul.fisher@tiledb.com>
    go install github.com/kevinburke/go-bindata/go-bindata@latest
    go generate ./generator

Signed-off-by: Paul Fisher <paul.fisher@tiledb.com>
Signed-off-by: Paul Fisher <paul.fisher@tiledb.com>
@codecov
Copy link

codecov bot commented Dec 23, 2021

Codecov Report

Merging #2680 (e1238c8) into master (6da2b4e) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2680   +/-   ##
=======================================
  Coverage   82.96%   82.96%           
=======================================
  Files          54       54           
  Lines        9521     9521           
=======================================
  Hits         7899     7899           
  Misses       1111     1111           
  Partials      511      511           

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 6da2b4e...e1238c8. Read the comment docs.

@casualjim casualjim merged commit 14fb201 into go-swagger:master Dec 25, 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.

2 participants