In Go, methods can be defined on _______ types, including slices and maps.

  • All Data Types
  • Composite
  • Only Structs
  • Primitive
In Go, methods can be defined on all data types, not just structs. This includes slices and maps, allowing for more flexible and expressive code when working with various data structures.
Add your answer
Loading...

Leave a comment

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