Some Search Console rows look like literal path fragments (for example /go/url=) from redirects or analytics, not questions about the net/url API. This page instead matches golang url values, url.values golang, golang url add query parameters, golang url parameters, and golang http request parameters: building encoded query strings with net/url and reading them back from http.Request. For broader HTTP context, see HTTP in Go.
Tested with Go 1.24 on Linux.
golang url values and url.Values
url.Values is a map[string][]string with helpers for query strings. Typical flow for golang url add query parameters:
Set(key, value)replaces any existing values forkeywith a single value.Add(key, value)appends another value for the same key (multiple?tag=go&tag=linuxstyle).Encode()returns a safely escaped query string (without a leading?).
Build on top of url.URL by assigning RawQuery:
package main
import (
"fmt"
"io"
"net/http"
"net/http/httptest"
"net/url"
"strings"
)
func main() {
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
for k, vs := range r.URL.Query() {
fmt.Fprintf(w, "%s=%s\n", k, strings.Join(vs, ","))
}
}))
defer srv.Close()
base, _ := url.Parse(srv.URL)
q := base.Query()
q.Set("name", "Go Linux")
q.Set("id", "1")
q.Add("tag", "go")
q.Add("tag", "linux")
base.RawQuery = q.Encode()
resp, err := http.Get(base.String())
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Print(string(body))
}Run it locally; you should see lines such as name=Go Linux, id=1, and tag=go,linux (order may vary). The space in Go Linux is encoded in the real HTTP request even though this demo prints decoded keys and values.
golang http request parameters on the server
Inside a handler, r.URL.Query() returns the same url.Values type. Use Get("id") for a single value, or r.URL.Query()["tag"] when you need every repetition of a key.
Why not only fmt.Sprintf for URLs?
fmt.Sprintf("http://host/?q=%s", userInput) skips proper escaping and breaks on spaces, &, =, or non-ASCII text. Treat that pattern as a last resort for fixed demo strings; prefer url.Values or url.QueryEscape for golang url parameters built from variables.
Summary
Golang url values workflows center on url.Values: Set, Add, and Encode implement golang url add query parameters with correct escaping. golang http request parameters are read with r.URL.Query() on the server. Rows like /go?url= in analytics usually belong to redirect URLs, not this API surface—use net/url when you truly need golang pass multiple strings into URL style behavior safely.

