diff --git a/pkg/composableschemadsl/compiler/translator.go b/pkg/composableschemadsl/compiler/translator.go index 2a0a29d908..3d4fce70d7 100644 --- a/pkg/composableschemadsl/compiler/translator.go +++ b/pkg/composableschemadsl/compiler/translator.go @@ -718,10 +718,9 @@ func translateImport(tctx translationContext, importNode *dslNode, names *mapz.S globallyVisitedFiles: tctx.globallyVisitedFiles, locallyVisitedFiles: tctx.locallyVisitedFiles, }) - - var circularImportError *ErrCircularImport if err != nil { - if errors.As(err, circularImportError) { + var circularImportError *ErrCircularImport + if errors.As(err, &circularImportError) { // NOTE: The "%s" is an empty format string to keep with the form of ErrorWithSourcef return nil, importNode.ErrorWithSourcef(circularImportError.filePath, "%s", circularImportError.error.Error()) }