Skip to content

fix: detect colliding go imports at emit time#230

Merged
ivov merged 1 commit into
mainfrom
detect-go-import-collision
Apr 29, 2026
Merged

fix: detect colliding go imports at emit time#230
ivov merged 1 commit into
mainfrom
detect-go-import-collision

Conversation

@ivov
Copy link
Copy Markdown
Owner

@ivov ivov commented Apr 29, 2026

Adds a diagnostic when two Go packages emitted into the same Go file default to the same package name. Previously the user saw a raw go build failure with redeclared in this block and no hint where it came from.

import "go:entgo.io/ent/dialect/sql"

fn main() {
  let driver = sql.Open(dialect.Postgres, dsn)?
}

Compiling this now reports the collision between entgo.io/ent/dialect/sql and database/sql (pulled in transitively by ent's typedefs) and suggests import entsql "go:entgo.io/ent/dialect/sql".

Complements #212 and #217, which alias colliding imports inside generated typedefs. This catches the case those cannot see, i.e. a user's direct import colliding with a transitive one.

@ivov ivov merged commit e13c215 into main Apr 29, 2026
4 checks passed
This was referenced Apr 29, 2026
@ivov
Copy link
Copy Markdown
Owner Author

ivov commented Apr 30, 2026

Released in lisette-v0.1.23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant