i have the books with different tags (crime, fantastic, dramatic etc.). that's my sql-code:
query := `
SELECT gotoboox.books.id, gotoboox.books.title
FROM gotoboox.books
LEFT JOIN gotoboox.books_tags ON gotoboox.books.id = gotoboox.books_tags.book_id
LEFT JOIN gotoboox.tags ON gotoboox.books_tags.tag_id = gotoboox.tags.id
WHERE gotoboox.tags.title IN ($1)
GROUP BY gotoboox.books.title, gotoboox.books.id
`
rows, err := p.Db.Query(query, pq.Array(tags))
but i have got empty result. for example, if i write
..WHERE gotoboox.tags.title IN ('Crime', 'Comedia').. // WITHOUT pg.Array()
its okay.
so, i need pass correctly my pq.Array(tags) to the 'where in'-statement.
P.S. tags is a slice of strings. "tags []string"