In Go, the ________ interface allows you to define custom JSON marshaling and unmarshaling logic.

  • CustomJSON
  • JSONCustom
  • JSONable
  • Marshaler
The correct interface in Go that allows you to define custom JSON marshaling and unmarshaling logic is the json.Marshaler and json.Unmarshaler interfaces. By implementing these interfaces for a custom type, you can control how instances of that type are converted to JSON when marshaling and how JSON data is converted back to instances of that type when unmarshaling. This customization is useful when you need to handle special cases or non-standard JSON formatting requirements.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *