Skip to content

go run fails because of replace directive #4397

@Resteklicken

Description

@Resteklicken

Version

1.31.0

What happened?

I suddenly get an error from the go toolchain when it tries to download / run sqlc (see below).

Relevant log output

go run github.com/sqlc-dev/sqlc/cmd/sqlc@latest vet
go: github.com/sqlc-dev/sqlc/cmd/sqlc@latest (in github.com/sqlc-dev/sqlc@v1.31.0):
        The go.mod file for the module providing named packages contains one or
        more replace directives. It must not contain directives that would cause
        it to be interpreted differently than if it were the main module.
2026/04/20 08:08:44 exit status 1
exit status 1

Database schema

SQL queries

Configuration

Playground URL

No response

What operating system are you using?

Linux

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions