Skip to content

Commit

Permalink
Fix import name for pegomock in generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
petergtz committed May 4, 2023
1 parent 2af9258 commit c969304
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mockgen/mockgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ func generateUniquePackageNamesFor(importPaths map[string]bool) (packageMap, non
packageName = sanitizedPackagePathBaseName + strconv.Itoa(i)
}

// hardcode package name for pegomock, because it's hardcoded in the generated code too
if importPath == mockFrameworkImportPath {
packageName = "pegomock"
}

packageMap[importPath] = packageName
packageNamesAlreadyUsed[packageName] = true

Expand Down

0 comments on commit c969304

Please sign in to comment.