Partial updates with field masks 0 ▲ Redowan's Reflections 1 hour ago · Tech · hide · 0 comments u/SnooSongs6758 asked on r/golang: I’m creating a REST API using Golang v1.25, Gin v1.10.0, and Validator v10.20.0. I have a PATCH endpoint where, when the address attribute is: undefined -> keep the original data null -> delete the original data contains something -> replace the original data with the new Right now I’m using a pointer for it, so I can know when it’s null. The problem is that I couldn’t find a way to differentiate when the attribute is undefined or null. Does anyone know a way to check if a specific attribute is undefined? While the answers there explore how to support this case, I think we can simplify the design and make our lives considerably easier. Currently the address field does this: a string value updates the stored address in place null deletes the stored address and undefined signals a missing value, which keeps the original data It’s mixing value and intent within a single field. We can use address for the plain value and another field, update_mask, to… No comments yet. Log in to reply on the Fediverse. Comments will appear here.