this post was submitted on 31 Jul 2025
7 points (100.0% liked)

Golang

2610 readers
5 users here now

This is a community dedicated to the go programming language.

Useful Links:

Rules:

founded 2 years ago
MODERATORS
 

Marshaling the field is fine, so using the tag json:"-" won't work. I could use the UnmarshalJSON method on the struct, but I have no idea how to implement it.

I'd rather not make a duplicate of the struct with that field removed, as it causes quite a bit of code duplication, and it's pretty chaotic.

you are viewing a single comment's thread
view the rest of the comments
[–] lena 2 points 5 months ago

Yeah, I decided to just go with that approach to keep things separate. Thanks for the help!