When generating a decorator for an interface that references types from a Go module with a major-version suffix (e.g. github.com/antlr4-go/antlr/v4), gowrap can emit an import path without the /v4 suffix:
import "github.com/antlr4-go/antlr" // wrong
instead of:
import "github.com/antlr4-go/antlr/v4" // correct
This causes go mod tidy to pull in the legacy pseudo-version module (github.com/antlr4-go/antlr v0.0.0-...) rather than the intended v4 module.
Workaround
Declare imports explicitly in the template; otherwise goimports picks github.com/antlr4-go/antlr instead of .../antlr/v4.
import (
"errors"
"github.com/antlr4-go/antlr/v4"
)
When generating a decorator for an interface that references types from a Go module with a major-version suffix (e.g. github.com/antlr4-go/antlr/v4), gowrap can emit an import path without the /v4 suffix:
instead of:
This causes go mod tidy to pull in the legacy pseudo-version module (github.com/antlr4-go/antlr v0.0.0-...) rather than the intended v4 module.
Workaround
Declare imports explicitly in the template; otherwise goimports picks github.com/antlr4-go/antlr instead of .../antlr/v4.