func formAttributes(u string, form *goquery.Selection, schemeAndHost ...string) (string, string) { method, ok := form.Attr("method") if !ok { method = "GET" } action, ok := form.Attr("action") if !ok { action = u } if action, ok = MakeUrl(action, schemeAndHost...); !ok { return "", "" } return strings.ToUpper(method), action }