Do not use pointer to point when retrieving tags to edit

It is the same with go 16, but with Debian’s go 15 it fails and
I believe, but i am not sure, this is the reason.
This commit is contained in:
jordi fita mas 2023-05-27 20:51:36 +02:00
parent 19f81128ec
commit 27a266097a
4 changed files with 4 additions and 4 deletions

View File

@ -414,7 +414,7 @@ func ServeEditContactTags(w http.ResponseWriter, r *http.Request, params httprou
company := getCompany(r)
slug := params[0].Value
form := newTagsForm(companyURI(company, "/contacts/"+slug+"/tags"), slug, locale)
if notFoundErrorOrPanic(conn.QueryRow(r.Context(), `select array_to_string(tags, ',') from contact where slug = $1`, form.Slug).Scan(&form.Tags)) {
if notFoundErrorOrPanic(conn.QueryRow(r.Context(), `select array_to_string(tags, ',') from contact where slug = $1`, form.Slug).Scan(form.Tags)) {
http.NotFound(w, r)
return
}

View File

@ -397,7 +397,7 @@ func ServeEditExpenseTags(w http.ResponseWriter, r *http.Request, params httprou
company := getCompany(r)
slug := params[0].Value
form := newTagsForm(companyURI(company, "/expenses/"+slug+"/tags"), slug, locale)
if notFoundErrorOrPanic(conn.QueryRow(r.Context(), `select array_to_string(tags, ',') from expense where slug = $1`, form.Slug).Scan(&form.Tags)) {
if notFoundErrorOrPanic(conn.QueryRow(r.Context(), `select array_to_string(tags, ',') from expense where slug = $1`, form.Slug).Scan(form.Tags)) {
http.NotFound(w, r)
return
}

View File

@ -1066,7 +1066,7 @@ func ServeEditInvoiceTags(w http.ResponseWriter, r *http.Request, params httprou
company := getCompany(r)
slug := params[0].Value
form := newTagsForm(companyURI(company, "/invoices/"+slug+"/tags"), slug, locale)
if notFoundErrorOrPanic(conn.QueryRow(r.Context(), `select array_to_string(tags, ',') from invoice where slug = $1`, form.Slug).Scan(&form.Tags)) {
if notFoundErrorOrPanic(conn.QueryRow(r.Context(), `select array_to_string(tags, ',') from invoice where slug = $1`, form.Slug).Scan(form.Tags)) {
http.NotFound(w, r)
return
}

View File

@ -359,7 +359,7 @@ func ServeEditProductTags(w http.ResponseWriter, r *http.Request, params httprou
company := getCompany(r)
slug := params[0].Value
form := newTagsForm(companyURI(company, "/products/"+slug+"/tags"), slug, locale)
if notFoundErrorOrPanic(conn.QueryRow(r.Context(), `select array_to_string(tags, ',') from product where slug = $1`, form.Slug).Scan(&form.Tags)) {
if notFoundErrorOrPanic(conn.QueryRow(r.Context(), `select array_to_string(tags, ',') from product where slug = $1`, form.Slug).Scan(form.Tags)) {
http.NotFound(w, r)
return
}