Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Zhongpeng Lin <zplin@uber.com>
  • Loading branch information
sluongng and linzhp authored Dec 31, 2021
1 parent 7593191 commit e63e6bb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions go/tools/builders/compilepkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func compileArchive(

// This filter defines how generated source code should be treated by nogo.
//
// Use this to generated source file could be mapped back to original source.
// Use this to map generated source file back to original source.
// Assign an empty string value to exclude generated source from nogo run.
nogoSrcsTranslate := make(map[string]string)

Expand Down Expand Up @@ -369,10 +369,8 @@ func compileArchive(
outFactsPath := filepath.Join(workDir, nogoFact)
nogoSrcs := make([]string, 0, len(goSrcs))
for _, goSrc := range goSrcs {
if v, ok := nogoSrcsTranslate[goSrc]; ok {
if v != "" {
nogoSrcs = append(nogoSrcs, v)
}
if originSrc, ok := nogoSrcsTranslate[goSrc]; ok && originSrc != "" {
nogoSrcs = append(nogoSrcs, originSrc)
continue
}

Expand Down

0 comments on commit e63e6bb

Please sign in to comment.