The json.Marshal function in Go returns a ________ and an error.

  • map
  • slice
  • byte
  • []byte
The correct answer is option 4, "[]byte". The json.Marshal function in Go converts a Go data structure to JSON format and returns a []byte slice containing the JSON representation of the data along with an error, if any.
Add your answer
Loading...

Leave a comment

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