google / go-querystring

go-querystring is Go library for encoding structs into URL query strings.
https://pkg.go.dev/github.com/google/go-querystring/query
BSD 3-Clause "New" or "Revised" License
1.96k stars 172 forks source link

Encoder interface not respected for `interface{}` types #121

Open TomK opened 1 month ago

TomK commented 1 month ago

when encoding a struct field with an interface{} or any type, using a type that implements Encoder is not respected

It seems that only the field type in the struct is checked for Encoder interface, and not the value of the field.

Playground: https://go.dev/play/p/VTG-X_HgunK

TomK commented 1 month ago

@willnorris are you accepting PRs for this project? Is there any point in me investing time looking into this?

willnorris commented 1 month ago

I'm not actively using or working on the project anymore, so have been pretty resistant to adding new features. But something like this should likely be pretty small, so I think would be fine.