url.go
func (u *URL) Short() string {
	if u.Scheme == "" {
		return ""
	}

	s := schemeMap[u.Scheme].Aliases[0]

	if u.Scheme == "odbc" || u.Scheme == "oleodbc" {
		n := u.Proto
		if v, ok := schemeMap[n]; ok {
			n = v.Aliases[0]
		}
		s += "+" + n
	} else if u.Proto != "tcp" {
		s += "+" + u.Proto
	}

	s += ":"

	if u.User != nil {
		if un := u.User.Username(); un != "" {
			s += un + "@"
		}
	}

	if u.Host != "" {
		s += u.Host
	}

	if u.Path != "" && u.Path != "/" {
		s += u.Path
	}

	if u.Opaque != "" {
		s += u.Opaque
	}

	return s
}
func (u *URL) Short() string {
	if u.Scheme == "" {
		return ""
	}

	s := schemeMap[u.Scheme].Aliases[0]

	if u.Scheme == "odbc" || u.Scheme == "oleodbc" {
		n := u.Proto
		if v, ok := schemeMap[n]; ok {
			n = v.Aliases[0]
		}
		s += "+" + n
	} else if u.Proto != "tcp" {
		s += "+" + u.Proto
	}

	s += ":"

	if u.User != nil {
		if un := u.User.Username(); un != "" {
			s += un + "@"
		}
	}

	if u.Host != "" {
		s += u.Host
	}

	if u.Path != "" && u.Path != "/" {
		s += u.Path
	}

	if u.Opaque != "" {
		s += u.Opaque
	}

	return s
}
func ( u * URL ) Short ( ) string { if u . Scheme == " " { return " " } s := schemeMap [ u . Scheme ] . Aliases [ 0 ] if u . Scheme == " " || u . Scheme == " " { n := u . Proto if v , ok := schemeMap [ n ] ; ok { n = v . Aliases [ 0 ] } s += " " + n } else if u . Proto != " " { s += " " + u . Proto } s += " " if u . User != nil { if un := u . User . Username ( ) ; un != " " { s += un + " " } } if u . Host != " " { s += u . Host } if u . Path != " " && u . Path != " " { s += u . Path } if u . Opaque != " " { s += u . Opaque } return s }
// Short provides a short description of the user, host, and database.
Short provides a short description of the user host and database .