Skip to content

Golang imports non-deterministic order #4015

Open
@imedwei

Description

@imedwei

Version

1.29.0

What happened?

When I run sqlc generate, the generated Go code constantly changes the ordering of the imports. Often, the generated file is identical, except for the ordering difference.

import (
	"context"

	dto "iotadata/internal/dto"

	"github.com/jackc/pgx/v5/pgtype"
)
import (
	"context"

	"github.com/jackc/pgx/v5/pgtype"
	dto "iotadata/internal/dto"
)

Relevant log output

Database schema

SQL queries

Configuration

Playground URL

No response

What operating system are you using?

No response

What database engines are you using?

No response

What type of code are you generating?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions