formatifier.go
func ToURL(theString, subdomain string, secure bool) (string, error) {
	f := New(theString)

	if f.length < 4 {
		return "", errors.New(lengthError)
	}

	f.makeLower()

	if secure {
		if len(subdomain) > 0 {
			return fmt.Sprintf("https://%s.%s", subdomain, f.theString), nil
		}
		return fmt.Sprintf("https://%s", f.theString), nil
	}

	if len(subdomain) > 0 {
		return fmt.Sprintf("http://%s.%s", subdomain, f.theString), nil
	}
	return fmt.Sprintf("http://%s", f.theString), nil
}
func ToURL(theString, subdomain string, secure bool) (string, error) {
	f := New(theString)

	if f.length < 4 {
		return "", errors.New(lengthError)
	}

	f.makeLower()

	if secure {
		if len(subdomain) > 0 {
			return fmt.Sprintf("https://%s.%s", subdomain, f.theString), nil
		}
		return fmt.Sprintf("https://%s", f.theString), nil
	}

	if len(subdomain) > 0 {
		return fmt.Sprintf("http://%s.%s", subdomain, f.theString), nil
	}
	return fmt.Sprintf("http://%s", f.theString), nil
}
func ToURL ( theString , subdomain string , secure bool ) ( string , error ) { f := New ( theString ) if f . length < 4 { return " " , errors . New ( lengthError ) } f . makeLower ( ) if secure { if len ( subdomain ) > 0 { return fmt . Sprintf ( " " , subdomain , f . theString ) , nil } return fmt . Sprintf ( " " , f . theString ) , nil } if len ( subdomain ) > 0 { return fmt . Sprintf ( " " , subdomain , f . theString ) , nil } return fmt . Sprintf ( " " , f . theString ) , nil }
// ToURL will format the provided string as a URL.  HTTP and HTTPS
// are the only supported protocols at this time.
ToURL will format the provided string as a URL . HTTP and HTTPS are the only supported protocols at this time .