func (m StringIntMap) Value() (driver.Value, error) {
	v, err := json.Marshal(m)
	if err != nil {
		return nil, err
	}
	return string(v), nil
}
Value converts map to database value
package model
import (
	"database/sql/driver"
	"encoding/json"
	"errors"
	"time"
	"github.com/bojand/ghz/runner"
)
type LatencyDistributionList []*runner.LatencyDistribution
func (ld LatencyDistributionList) Value() (driver.Value, error) {
	v, err := json.Marshal(ld)
	if err != nil {
		return nil, err
	}
	return string(v), nil
}
func (ld *LatencyDistributionList) Scan(src interface{}) error {
	var sourceStr string
	sourceByte, ok := src.([]byte)
	if !ok {
		sourceStr, ok = src.(string)
		if !ok {
			return errors.New("type assertion from string / byte")
		}
		sourceByte = []byte(sourceStr)
	}
	var lds []runner.LatencyDistribution
	if err := json.Unmarshal(sourceByte, &lds); err != nil {
		return err
	}
	for index := range lds {
		*ld = append(*ld, &lds[index])
	}
	return nil
}
type StringIntMap map[string]int