Sample apps and code written for Google Cloud in the Go programming language.
This report summarizes scanner evidence for GoogleCloudPlatform/golang-samples, a Go project with 4,662 GitHub stars. SynthScan examined 255,166 lines of code across 2909 source files, recording 2903 pattern matches distributed across 11 syntactic categories. The legacy adjusted pattern signal is 11.6 (Moderate pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 2880 finding(s).
Are imports declared and package/API names verified? 23 finding(s).
Are wrappers, guards, and repeated structures necessary? 0 finding(s).
Which changes need focused human review? 2903 finding(s).
Run additional scans to build a history of the legacy pattern signal. Score changes are not a measure of AI adoption or code quality.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 2903 distinct pattern matches across 11 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | regiontag_test.go | 1 | // Copyright 2019 Google LLC | COMMENT |
| LOW | badfiles_test.go | 1 | // Copyright 2019 Google LLC | COMMENT |
| LOW | dataflow/flex-templates/wordcount/wordcount.go | 1 | // Copyright 2022 Google LLC | COMMENT |
| LOW | dataflow/flex-templates/wordcount/wordcount_test.go | 1 | // Copyright 2022 Google LLC | COMMENT |
| LOW | privateca/create_ca.go | 1 | // Copyright 2023 Google LLC | COMMENT |
| LOW | privateca/undelete_ca.go | 1 | // Copyright 2023 Google LLC | COMMENT |
| LOW | privateca/revoke_certificate.go | 1 | // Copyright 2023 Google LLC | COMMENT |
| LOW | privateca/privateca_test.go | 1 | // Copyright 2023 Google LLC | COMMENT |
| LOW | privateca/create_certificate.go | 1 | // Copyright 2023 Google LLC | COMMENT |
| LOW | privateca/delete_ca.go | 1 | // Copyright 2023 Google LLC | COMMENT |
| LOW | privateca/list_cas.go | 1 | // Copyright 2023 Google LLC | COMMENT |
| LOW | privateca/list_certificates.go | 1 | // Copyright 2023 Google LLC | COMMENT |
| LOW | privateca/disable_ca.go | 1 | // Copyright 2023 Google LLC | COMMENT |
| LOW | privateca/delete_ca_pool.go | 1 | // Copyright 2023 Google LLC | COMMENT |
| LOW | privateca/create_ca_pool.go | 1 | // Copyright 2023 Google LLC | COMMENT |
| LOW | privateca/enable_ca.go | 1 | // Copyright 2023 Google LLC | COMMENT |
| LOW | kms/get_retired_resource.go | 1 | // Copyright 2026 Google LLC | COMMENT |
| LOW | kms/kms_helpers_test.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/disable_key_version.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/create_import_job.go | 1 | // Copyright 2023 Google LLC | COMMENT |
| LOW | kms/update_key_update_labels.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/update_key_add_rotation.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/import_manually_wrapped_key.go | 1 | // Copyright 2023 Google LLC | COMMENT |
| LOW | kms/create_key_for_import.go | 1 | // Copyright 2023 Google LLC | COMMENT |
| LOW | kms/update_key_remove_labels.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/create_key_labels.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/generate_random_bytes.go | 1 | // Copyright 2021 Google LLC | COMMENT |
| LOW | kms/iam_add_member.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/iam_get_policy.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/check_state_import_job.go | 1 | // Copyright 2023 Google LLC | COMMENT |
| LOW | kms/create_key_asymmetric_decrypt.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/update_key_remove_rotation.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/restore_key_version.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/verify_mac.go | 1 | // Copyright 2021 Google LLC | COMMENT |
| LOW | kms/create_key_mac.go | 1 | // Copyright 2021 Google LLC | COMMENT |
| LOW | kms/delete_key_version.go | 1 | // Copyright 2026 Google LLC | COMMENT |
| LOW | kms/update_key_set_primary.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/destroy_key_version.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/create_key_rotation_schedule.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/create_key_ring.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/create_key_version.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/encrypt_asymmetric.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/verify_asymmetric_ec.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/get_public_key.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/create_key_asymmetric_sign.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/sign_mac.go | 1 | // Copyright 2021 Google LLC | COMMENT |
| LOW | kms/get_key_version_attestation.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/check_state_imported_key.go | 1 | // Copyright 2023 Google LLC | COMMENT |
| LOW | kms/decrypt_symmetric.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/get_key_labels.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/iam_remove_member.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/create_key_hsm.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/kms_test.go | 1 | // Copyright 2023 Google LLC | COMMENT |
| LOW | kms/verify_asymmetric_rsa.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/delete_key.go | 1 | // Copyright 2026 Google LLC | COMMENT |
| LOW | kms/encrypt_symmetric.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/encapsulate_mlkem.go | 1 | // Copyright 2025 Google LLC | COMMENT |
| LOW | kms/sign_asymmetric.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| LOW | kms/decapsulate.go | 1 | // Copyright 2025 Google LLC | COMMENT |
| LOW | kms/create_key_symmetric_encrypt_decrypt.go | 1 | // Copyright 2020 Google LLC | COMMENT |
| 2803 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | eventarc/audit_iam/main_test.go | 33 | PrincipalEmail: "user@example.com", | CODE |
| LOW | dlp/snippets/inspect/inspect_table.go | 54 | StringValue: "John Doe", | CODE |
| LOW | …nippets/inspect/inspect_string_with_exclusion_regex.go | 32 | // textToInspect := "Some email addresses: gary@example.com, bob@example.org" | COMMENT |
| LOW | …ets/inspect/inspect_send_data_to_hybrid_job_trigger.go | 34 | // textToDeIdentify := "My email is test@example.org" | COMMENT |
| LOW | …ts/inspect/inspect_string_with_exclusion_regex_test.go | 27 | if err := inspectStringWithExclusionRegex(&buf, tc.ProjectID, "Some email addresses: gary@example.com, bob@example.org" | CODE |
| LOW | …ts/inspect/inspect_string_with_exclusion_regex_test.go | 33 | if want := "Quote: bob@example.org"; !strings.Contains(got, want) { | CODE |
| LOW | …pets/deid/deid_table_with_multiple_crypto_hash_test.go | 35 | if want := "user1@example.org"; strings.Contains(got, want) { | CODE |
| LOW⚡ | dlp/snippets/deid/deid_table_with_crypto_hash.go | 33 | {Type: &dlppb.Value_StringValue{StringValue: "user1@example.org"}}, | CODE |
| LOW⚡ | dlp/snippets/deid/deid_table_with_crypto_hash.go | 40 | {Type: &dlppb.Value_StringValue{StringValue: "user2@example.org"}}, | CODE |
| LOW⚡ | dlp/snippets/deid/deid_table_with_crypto_hash.go | 47 | {Type: &dlppb.Value_StringValue{StringValue: "user3@example.org"}}, | CODE |
| LOW | …/snippets/deid/deid_table_with_multiple_crypto_hash.go | 35 | {Type: &dlppb.Value_StringValue{StringValue: "user1@example.org"}}, | CODE |
| LOW⚡ | dlp/snippets/deid/deid_table_with_crypto_hash_test.go | 38 | if want := "user3@example.org"; strings.Contains(got, want) { | CODE |
| LOW⚡ | dlp/snippets/deid/deid_table_with_crypto_hash_test.go | 44 | if want := "user2@example.org"; strings.Contains(got, want) { | CODE |
| LOW⚡ | dlp/snippets/deid/deid_table_with_crypto_hash_test.go | 50 | if want := "user1@example.org"; strings.Contains(got, want) { | CODE |
| LOW | dlp/snippets/deid/deid_with_exception_list.go | 59 | Words: []string{"jack@example.org", "jill@example.org"}, | CODE |
| LOW | …ctionsv2/label_gce_instance/label_gce_instance_test.go | 89 | "principalEmail": "user@example.com", | CODE |
| LOW | …ctionsv2/label_gce_instance/label_gce_instance_test.go | 110 | "principalEmail": "user@example.com", | CODE |
| LOW | genai/live/live_examples_test.go | 40 | Name: "John Doe", | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | internal/aeintegrate/aeintegrate.go | 334 | _, err = p.adminService.Apps.Services.Versions.Delete(p.ProjectID, p.Service, p.version()).Do() | CODE |
| CRITICAL | container/listclusters/listclusters.go | 77 | poolList, err := svc.Projects.Zones.Clusters.NodePools.List(projectID, zone, v.Name).Do() | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | docs/appengine/mail/mailgun/mailgun.go | 31 | "YOUR_API_KEY", // API Key | CODE |
| HIGH | docs/appengine/mail/mailgun/mailgun.go | 56 | "YOUR_API_KEY", // API Key | CODE |
| HIGH | genai/express_mode/expressmode_with_api_key.go | 34 | apiKey := "YOUR_API_KEY" | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/appengine/tools/unittest/package.go | 31 | Body: "Don't forget to test your code!", | CODE |
| LOW | docs/appengine/tools/unittest/package.go | 45 | Body: "Don't forget to test your code!", | CODE |
| MEDIUM | storage/objects/generate_encryption_key.go | 28 | // This is included for demonstration purposes. You should generate your own | COMMENT |
| MEDIUM | cloudsql/postgres/database-sql/deployment.yaml | 77 | # If connecting from a VPC-native GKE cluster, you can use the | COMMENT |
| MEDIUM | cloudsql/mysql/database-sql/deployment.yaml | 77 | # If connecting from a VPC-native GKE cluster, you can use the | COMMENT |
| MEDIUM | cloudsql/sqlserver/database-sql/deployment.yaml | 66 | # If connecting from a VPC-native GKE cluster, you can use the | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | …able/bigquery_create_table_external_hivepartitioned.go | 53 | // so we can add an optional Hive partitioning configuration to leverage the object paths for deriving | COMMENT |
| MEDIUM | bigquery/bigquery_storage_quickstart/main.go | 243 | // records necessitate a more robust implementation. See the goavro library | COMMENT |
| MEDIUM | run/logging-manual/main.go | 15 | // Sample logging-manual shows how to leverage Cloud Run structured logging without a client library. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | memorystore/redis/gce_deployment/startup-script.sh | 32 | # Create a goapp user. The application will run as this user. | COMMENT |
| MEDIUM | memorystore/redis/gce_deployment/deploy.sh | 32 | # Create an instance | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | kms/update_key_update_labels.go | 41 | // Step 1 - get the current set of labels on the key | COMMENT |
| LOW | kms/update_key_update_labels.go | 56 | // Step 2 - add a label to the list of labels | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | profiler/snippets/snippets.go | 39 | // TODO: Handle error. | COMMENT |
| LOW | profiler/appengine/appengine.go | 33 | // TODO: Handle error. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | …entelemetry/instrumentation/otel-collector-config.yaml | 48 | # Check if the parsed JSON actually contains trace context before extracting | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | compute/disks/create_hyperdisk_from_pool.go | 31 | // Example usage: | COMMENT |