带有毒蛇的嵌套结构片段

Is there a way to pass nested slice of arbitrary struct via environment variables? The below code works fine with a yaml config file but I'm not able to get it working via env (for production)

package main

import (
    "log"
    "strings"

    "github.com/spf13/viper"
)

type HostConfig struct {
    Host string `mapstructure:"host"`
    Port int    `mapstructure:"port"`
}

type Config struct {
    ClusterMode bool `mapstructure:"cluster_mode"`

    Hosts []HostConfig `mapstructure:"hosts"`
}

func main() {
    viper.SetEnvPrefix("service")

    replacer := strings.NewReplacer(".", "_")
    viper.SetEnvKeyReplacer(replacer)

    viper.AutomaticEnv()

    var cfg Config
    err := viper.UnmarshalKey("redis", &cfg)

    log.Printf("cfg: %+v

err: %+v", cfg, err)
}
$ SERVICE_REDIS={"cluster_mode":"true","hosts":[{"host":"abc","port":123}]} go run main.go
2019/02/01 12:50:53 cfg: {ClusterMode:false PoolSize:0 Hosts:[]}

err: '' expected a map, got 'string'