fix: slice envs

This commit is contained in:
Lakhan Samani
2022-05-31 08:14:03 +05:30
parent c61c3024ec
commit cf8762b7a0
35 changed files with 557 additions and 317 deletions

View File

@@ -0,0 +1,16 @@
package types
import "encoding/json"
// Type for interface slice. Used for redis store.
type InterfaceSlice []interface{}
// MarshalBinary for interface slice.
func (s InterfaceSlice) MarshalBinary() ([]byte, error) {
return json.Marshal(s)
}
// UnmarshalBinary for interface slice.
func (s *InterfaceSlice) UnmarshalBinary(data []byte) error {
return json.Unmarshal(data, s)
}