Re: [go-nuts] jackc/pgx: error handling

2021-10-18 Thread Larry Rosenman
I had a misunderstanding of what imports needed to be included, and a fundamental misunderstanding of type vs field. I added an import of: github.com/jackc/pgconn and changed the declaration to var pgError *pgconn.PgError and now I'm fine. On Mon, Oct 18, 2021 at 10:24 PM Kurtis Rader wrote:

Re: [go-nuts] jackc/pgx: error handling

2021-10-18 Thread Kurtis Rader
For future readers who stumble upon this thread it would be nice if you explained the problem and solution in more detail. On Mon, Oct 18, 2021 at 8:21 PM Larry Rosenman wrote: > I'm translating an OLD program from lib/pq to pgx, but when I copy the > "Error Handling" code, I get: >

[go-nuts] jackc/pgx: error handling

2021-10-18 Thread Larry Rosenman
I found my error with some help on a slack channel.  Thanks, though. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To

[go-nuts] jackc/pgx: error handling

2021-10-18 Thread Larry Rosenman
I'm translating an OLD program from lib/pq to pgx, but when I copy the "Error Handling" code, I get: ./ambientProgram.go:164:16: db.PgError undefined (type *pgx.Conn has no field or method PgError) ./ambientProgram.go:210:18: db.PgError undefined (type *pgx.Conn has no field or method

[go-nuts] question about httputil. NewSingleHostReverseProxy

2021-10-18 Thread Vasiliy Tolstov
Hi. I'm use go reverse proxy in some project and have a question https://cs.opensource.google/go/go/+/refs/tags/go1.17.2:src/net/http/httputil/reverseproxy.go;l=323 why headers when copied added to already written? Why copyHeader do Add method for header and not Set ? For example - I have

Re: [go-nuts] ast.NewPackage errors for built in types

2021-10-18 Thread Steven Hartland
Thanks for that. I spent some time over the weekend refactoring from raw ast parser with a simpleImporter and universe to using types . So far this has provided everything I need, and also massively simplified the code as no need to