Pgx: `dep ensure` not working for v4 and up

Created on 17 Oct 2019  路  4Comments  路  Source: jackc/pgx

We use dep to manage dependencies in a project at work and I've been trying to update pgx this week, I managed to go from v3.2.0 to v3.6.0 with no issues. Whenever I try versions v4.0.0 and up I run into this problem

v4.1.0: "github.com/jackc/pgx" imports "github.com/jackc/pgx/v4/internal/sanitize", which contains malformed code: no package exists at "github.com/jackc/pgx/v4/internal/sanitize"
v4.0.1: "github.com/jackc/pgx" imports "github.com/jackc/pgx/v4/internal/sanitize", which contains malformed code: no package exists at "github.com/jackc/pgx/v4/internal/sanitize"
v4.0.0: "github.com/jackc/pgx" imports "github.com/jackc/pgx/v4/internal/sanitize", which contains malformed code: no package exists at "github.com/jackc/pgx/v4/internal/sanitize"

Don't suppose you would know what my options would be here?

Happy to provide more information if you need it.

Most helpful comment

Moving to Go modules is the right solution.

It'd probably be possible to get it working by vendoring all the packages in the appropriate v2, v3, v4`, etc. directories but it would definitely be a dirty hack.

All 4 comments

The import path for pgx v4 is github.com/jackc/pgx/4. It looks like it is vendored such that the v4 code is at path github.com/jackc/pgx. But then the internal imports fail because they are looking for the v4 path.

Thanks for the explanation, is there any course of action I could take to fix the issue? If not I'll just need to set some time aside to move over to using Go modules.

Moving to Go modules is the right solution.

It'd probably be possible to get it working by vendoring all the packages in the appropriate v2, v3, v4`, etc. directories but it would definitely be a dirty hack.

No worries, I'll do just that. Thanks for your help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jeromer picture jeromer  路  5Comments

bernhardreiter picture bernhardreiter  路  7Comments

kokizzu picture kokizzu  路  6Comments

MOZGIII picture MOZGIII  路  4Comments

Oliver-Fish picture Oliver-Fish  路  4Comments