func customDecodeHook(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) {
	durationHook := mapstructure.StringToTimeDurationHookFunc()
	dur, err := mapstructure.DecodeHookExec(durationHook, f, t, data)
	if err == nil {
		if _, ok := dur.(time.Duration); ok {
			return dur, nil
		}
	}
	if f.Kind() != reflect.String {
		return data, nil
	}
	raw := data.(string)
	l := len(raw)
	if l > 1 && raw[0] == '[' && raw[l-1] == ']' {
		slice := strings.Split(raw[1:l-1], ",")
		for i, v := range slice {
			slice[i] = strings.TrimSpace(v)
		}
		return slice, nil
	}
	return data, nil
}
customDecodeHook adds the additional functions of parsing durations from strings
as well as parsing strings of the format "[thing1, thing2, thing3]" into string slices
Note that whitespace around slice elements is removed
package viperutil
import (
	"encoding/pem"
	"fmt"
	"io/ioutil"
	"math"
	"reflect"
	"regexp"
	"strconv"
	"strings"
	"time"
	"github.com/mitchellh/mapstructure"
	"github.com/pkg/errors"
	"github.com/spf13/viper"
)