Type assertion in Go is performed using the syntax _______.

  • .(assert)
  • .(assertion)
  • .(type)
  • .(value)
In Go, type assertion is performed using the syntax .(type), where type is the specific type that you are asserting. This syntax is used to extract the concrete value of the underlying type from an interface value. It helps in accessing the underlying concrete type and its value safely.
Add your answer
Loading...

Leave a comment

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