title: is there a way to iterate over constant used as enum
body: <p>I am trying to use enum in golang as below. I am struggling to find a easy way to iterate over the list of constant values. What are common practice in golang to iterate over constant values used as enum. Thanks!</p>
  
  <pre><code>type DayOfWeek int
  const(
         Monday DayOfWeek = iota
         Tuesday
         Wednesday
         Thursday
         Friday
         Saturday
         Sunday
        )
  </code></pre>
  
  <p>In Java, we can iterate as below.</p>
  
  <pre><code>public enum DayOfWeek {
      MONDAY, 
      TUESDAY,
      WEDNESDAY,
      THURSDAY,
      FRIDAY,
      SATURDAY,
      SUNDAY
  }
  
  for (DayOfWeek day: DayOfWeek.values()) {
     // code logic
  }
  </code></pre>