package sample

import "encoding/json"

func EncodeAll(items []string) ([][]byte, error) {
	out := make([][]byte, 0, len(items))
	for _, item := range items {
		payload, err := json.Marshal(item)
		if err != nil {
			return nil, err
		}
		out = append(out, payload)
	}

	return out, nil
}