func (country Country) Value() (value driver.Value, err error) {
	if country == "" {
		return "", nil
	}
	if err = country.Validate(); err != nil {
		return nil, err
	}
	return country.String(), nil
}
Value implementation of driver.Valuer
package currency
import (
	"database/sql/driver"
	"encoding/json"
	"fmt"
)
type Country string