How are fields accessed in a struct?

  • By using arrow notation
  • By using bracket notation
  • By using dot notation
  • By using parenthesis notation
Fields in a struct are accessed using dot notation in Go. This involves typing the name of the struct variable followed by a dot (.) and then the name of the field to access its value.
Add your answer
Loading...

Leave a comment

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