Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
containeranalysis
✓ cloud.google.com/go/containeranalysis/apiv1
List container analysis occurrences for a GCP project.
package main
import (
"context"
"fmt"
containeranalysis "cloud.google.com/go/containeranalysis/apiv1"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
client, err := containeranalysis.NewClient(ctx)
if err != nil {
panic(err)
}
defer client.Close()
// List occurrences
req := &containeranalysispb.ListOccurrencesRequest{
Parent: "projects/my-project",
}
it := client.ListOccurrences(ctx, req)
for {
occ, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
panic(err)
}
fmt.Println(occ)
}
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
0.19.0latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.