kong icon indicating copy to clipboard operation
kong copied to clipboard

Add support for pointer fields.

Open scottwis opened this issue 3 years ago • 7 comments

scottwis avatar Mar 13 '22 02:03 scottwis

I think the check here needs to be updated to account for the possibility of *bool fields (otherwise you can't make a *bool field negatable): https://github.com/alecthomas/kong/blob/556f8b773b24e22c5dcb05a1a740567c19d1ef99/tag.go#L174

Also here: https://github.com/alecthomas/kong/blob/deebf0b09b7bdda61ec299ab90aaaa341436dd4b/model.go#L311

haines avatar Mar 18 '22 12:03 haines

@haines I think bool pointers should work just fine. I added some tests for various bool* cases. Let me know if there's something I missed.

scottwis avatar Mar 19 '22 19:03 scottwis

@scottwis could you please check if you can use the negatable:"" tag with *bool fields (might be worth adding a test case for it)?

haines avatar Mar 19 '22 20:03 haines

@alecthomas @haines @shueybubbles

I believe I have all comments addressed. Can you please take another look?

scottwis avatar Mar 19 '22 20:03 scottwis

Ping. This is not passing lint.

alecthomas avatar Mar 28 '22 19:03 alecthomas

@scottwis should I fix this (either //nolint or remove the fields) and push it?

jh125486 avatar Apr 07 '22 19:04 jh125486

I needed this exact feature, hope it can get merged in soon. Thanks for implementing this :)

stevekm avatar Jun 16 '22 13:06 stevekm

This was merged in #296

alecthomas avatar Sep 20 '22 12:09 alecthomas

Thanks for all the work and apologies for the delay in responding.

alecthomas avatar Sep 20 '22 12:09 alecthomas

this is perfect thanks so much

stevekm avatar Dec 20 '22 04:12 stevekm