func (u Path) Query(key string, value string) (Path, error) {
	// If value is empty, nothing to change and return back the original
	// path.
	if strings.TrimSpace(value) == "" {
		return u, nil
	}

	baseQuery, err := url.ParseQuery(u.base.RawQuery)
	if err != nil {
		return Path{}, errors.Trace(err)
	}

	baseQuery.Add(key, value)
	newURL, err := url.Parse(u.base.String())
	if err != nil {
		return Path{}, errors.Trace(err)
	}

	newURL.RawQuery = baseQuery.Encode()

	return MakePath(newURL), nil
}
// Query adds additional query parameters to the Path.
// Example:
//  - http://baseurl/name0/name1?q=value
//
Query adds additional query parameters to the Path.
// Query adds additional query parameters to the Path . // Example : // - http : // baseurl / name0 / name1?q = value //
func (u Path) Query(key string, value string) (Path, error) {
	if strings.TrimSpace(value) == "" {
		return u, nil
	}
	baseQuery, err := url.ParseQuery(u.base.RawQuery)
	if err != nil {
		return Path{}, errors.Trace(err)
	}
	baseQuery.Add(key, value)
	newURL, err := url.Parse(u.base.String())
	if err != nil {
		return Path{}, errors.Trace(err)
	}
	newURL.RawQuery = baseQuery.Encode()
	return MakePath(newURL), nil
}
func ( u Path ) Query ( key string , value string ) ( Path , error ) { if strings . TrimSpace ( value ) == " " { return u , nil } baseQuery , err := url . ParseQuery ( u . base . RawQuery ) if err != nil { return Path { } , errors . Trace ( err ) } baseQuery . Add ( key , value ) newURL , err := url . Parse ( u . base . String ( ) ) if err != nil { return Path { } , errors . Trace ( err ) } newURL . RawQuery = baseQuery . Encode ( ) return MakePath ( newURL ) , nil }
Query adds additional query parameters to the Path.
Query adds additional query parameters to the Path .
// If value is empty, nothing to change and return back the original // path.