title: Check if value exists in enum
body: <p>I have created a strict like the following in my app:</p>
  
  <pre>type Datatype int8
  
  const (
      user Datatype = iota
      address
      test
  )
  
  var datatypes = [...]string{"User", "Address", "Test"}
  
  func (datatype Datatype) String() string {
      return datatypes[datatype]
  }</pre>
  
  <p>I would like to be able to validate a value passed via a <em>command-line</em> flag against this enum. </p>
  
  <p>I thought I had seen something like <code>dtype == Datatype</code> being used, but I am apparently sorely mistaken. </p>
  
  <p>If this is not possible I can go the route of putting these values in an array. However, I feel the enum approach is more elegant.</p>