You're developing a Go application where you need to declare a constant named 'MaxRetryAttempts' to specify the maximum number of retry attempts. Which data type would you use for this constant?

  • bool
  • float64
  • int
  • string
In Go, constants can be of various types including numeric constants. Since 'MaxRetryAttempts' is specifying the maximum number of retry attempts, it would typically be represented as an integer. Therefore, you'd use the 'int' data type for this constant.
Add your answer
Loading...

Leave a comment

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