title: How to get a value which is a list from redis key-value store in golang?
body: <p>I am writing a function in golang to get the value from redis db by passing the key. The value is a list. I am using 'GET' redis command to get the value. But it is giving me error.</p>
  
  <p>You can find below the code,</p>
  
  <pre><code>func GetValue(key string) []string {
      var value []string
      var err error
      value, err = redis.Strings(conn.Do("GET", key))
  
      if err != nil {
          log.Fatal(err)
      }
      fmt.Println(value)
      return value
  }
  
  func RetrieveValue() {
      keyType, _ := conn.Do("TYPE", recentItemKey)
      fmt.Println("Type", keyType)
  
      var results []string
      results = GetValue(recentItemKey)
  
      for _, val := range results {
          fmt.Println(val)
      }
  }
  </code></pre>
  
  <p>And the output is here,</p>
  
  <pre><code>Type list
  2015/03/14 19:09:12 WRONGTYPE Operation against a key holding the wrong kind of value
  exit status 1
  </code></pre>
  
  <p><strong>Version</strong></p>
  
  <pre><code>Go 1.4.2
  Redis-2.8.19
  </code></pre>
  
  <p><strong>Redis Go Library</strong></p>
  
  <pre><code>github.com/garyburd/redigo/redis
  </code></pre>
  
  <p>Could anyone help me on this.? Thank you</p>