Skip to content

Commit c94dddc

Browse files
authored
fix(internal/gapicgen): don't try to make snippets for non-gapics (#5919)
1 parent a195835 commit c94dddc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/gapicgen/gensnippets/gensnippets.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ func processExamples(pkg *doc.Package, fset *token.FileSet, trimPrefix, rootDir,
133133
if err != nil {
134134
return []error{err}
135135
}
136+
if apiInfo == nil {
137+
// There was no gapic_metadata.json, skip processing examples for
138+
// non gapic lib.
139+
return nil
140+
}
136141

137142
regionTags := apiInfo.RegionTags()
138143
if len(regionTags) == 0 {

0 commit comments

Comments
 (0)