// GenScheme returns a func that generates a scheme:// style DSN from the
// passed URL.
GenScheme returns a func that generates a scheme:// style DSN from the
passed URL.
// GenScheme returns a func that generates a scheme : // style DSN from the // passed URL .
func GenScheme(scheme string) func(*URL) (string, error) {
	return func(u *URL) (string, error) {
		host := u.Host
		if host == "" {
			host = "localhost"
		}
		z := &url.URL{
			Scheme:   scheme,
			Opaque:   u.Opaque,
			User:     u.User,
			Host:     host,
			Path:     u.Path,
			RawPath:  u.RawPath,
			RawQuery: u.RawQuery,
			Fragment: u.Fragment,
		}
		return z.String(), nil
	}
}
func GenScheme ( scheme string ) func ( * URL ) ( string , error ) { return func ( u * URL ) ( string , error ) { host := u . Host if host == " " { host = " " } z := & url . URL { Scheme : scheme , Opaque : u . Opaque , User : u . User , Host : host , Path : u . Path , RawPath : u . RawPath , RawQuery : u . RawQuery , Fragment : u . Fragment , } return z . String ( ) , nil } }
GenScheme returns a func that generates a scheme:// style DSN from the
passed URL.
GenScheme returns a func that generates a scheme : // style DSN from the passed URL .