title: Can't marshal, (implement encoding.BinaryMarshaler). go-redis Sdd with multiple objects
body: <p>I have a following piece of code in which I am trying to add an array to a redis set but it is giving me an error.</p>
  
  <pre><code>package main
  
  import (
      "encoding/json"
      "fmt"
  
      "github.com/go-redis/redis"
  )
  
  type Info struct {
      Name string
      Age  int
  }
  
  func (i *Info) MarshalBinary() ([]byte, error) {
      return json.Marshal(i)
  }
  func main() {
      client := redis.NewClient(&amp;redis.Options{
          Addr:        "localhost:6379",
          Password:    "",
          DB:          0,
          ReadTimeout: -1,
      })
  
      pong, err := client.Ping().Result()
  
      fmt.Print(pong, err)
  
      infos := [2]Info{
          {
              Name: "tom",
              Age:  20,
          },
          {
              Name: "john doe",
              Age:  30,
          },
      }
  
      pipe := client.Pipeline()
      pipe.Del("testing_set")
      // also tried this
      // pipe.SAdd("testing_set", []interface{}{infos[0], infos[1]})
      pipe.SAdd("testing_set", infos)
      _, err = pipe.Exec()
      fmt.Println(err)
  }
  
  
  </code></pre>
  
  <p>I get the error <code>can't marshal [2]main.Info (implement encoding.BinaryMarshaler)</code></p>
  
  <p>I have also tried to convert each info to <code>[]byte</code> and pass in the <code>[][]byte...</code> to <code>SAdd</code> but same error. How would I do this idomatically?</p>