Skip to content

Commit

Permalink
add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hgiasac committed Feb 24, 2024
1 parent 376260a commit 27158e8
Show file tree
Hide file tree
Showing 8 changed files with 758 additions and 188 deletions.
7 changes: 4 additions & 3 deletions codegen/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ func parseAndGenerateConnector(basePath string, directories []string, moduleName
if err := os.Chdir(basePath); err != nil {
return err
}
sm, err := parseRawConnectorSchemaFromGoCode(".", directories)

sm, err := parseRawConnectorSchemaFromGoCode(moduleName, ".", directories)
if err != nil {
return err
}
Expand All @@ -48,8 +49,8 @@ func generateConnector(rawSchema *RawConnectorSchema, srcPath string, moduleName
}

importLines := []string{}
for _, pkgName := range rawSchema.PackageNames {
importLines = append(importLines, fmt.Sprintf(`"%s/%s"`, moduleName, pkgName))
for importPath := range rawSchema.Imports {
importLines = append(importLines, importPath)
}
targetPath := path.Join(srcPath, connectorOutputFile)
f, err := os.Create(targetPath)
Expand Down
Loading

0 comments on commit 27158e8

Please sign in to comment.