fiber icon indicating copy to clipboard operation
fiber copied to clipboard

🐛 [Bug]: using value obtained using unexported field

Open lublak opened this issue 6 months ago • 3 comments

Bug Description

Currently in v3 (not testet in v2): If you parse the query to an struct which has private fields you get a panic error:

using value obtained using unexported field

How to Reproduce

Steps to reproduce the behavior:

  1. Create a struct with private/not exported fields
  2. c.Bind().Query(&p) to the struct

Expected Behavior

should be throw a normal error and not panic

Fiber Version

v3.0.0-beta.4

Code Snippet (optional)


Checklist:

  • [x] I agree to follow Fiber's Code of Conduct.
  • [x] I have checked for existing issues that describe my problem prior to opening this one.
  • [x] I understand that improperly formatted bug reports may be closed without explanation.

lublak avatar Jun 03 '25 14:06 lublak

Thanks for opening your first issue here! 🎉 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

welcome[bot] avatar Jun 03 '25 14:06 welcome[bot]

Should be fixed with this https://github.com/gofiber/schema/pull/24 Can you test with the main branch or the latest schema version in your go.mod?

ReneWerner87 avatar Jun 03 '25 15:06 ReneWerner87

@ReneWerner87 I will check it next week!

lublak avatar Jun 14 '25 10:06 lublak

@ReneWerner87 Where I had spontaneously taken a holiday because it was so warm. But yes, better late than never. I have tested it and it is fixed, now runs to an error message and not to a panic.

lublak avatar Jun 27 '25 09:06 lublak