Skip to content

chore(gae): replicate snippet-bot result for go11x/helloworld #5199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
4 changes: 0 additions & 4 deletions appengine/go11x/cloudsql/cloudsql.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// [START gae_cloudsql]

// Sample cloudsql demonstrates connection to a Cloud SQL instance from App Engine standard.
package main

Expand Down Expand Up @@ -119,5 +117,3 @@ func mustGetenv(k string) string {
}
return v
}

// [END gae_cloudsql]
22 changes: 0 additions & 22 deletions appengine/go11x/helloworld/helloworld.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// [START gae_go111_app]

// Sample helloworld is an App Engine app.
package main

// [START gae_go111_import]
import (
"fmt"
"log"
"net/http"
"os"
)

// [END gae_go111_import]

// [START gae_go111_main_func]
// [START main_func]

func main() {
http.HandleFunc("/", indexHandler)

// [START gae_go111_setting_port]
// [START setting_port]
port := os.Getenv("PORT")
if port == "" {
port = "8080"
Expand All @@ -45,16 +35,8 @@ func main() {
if err := http.ListenAndServe(":"+port, nil); err != nil {
log.Fatal(err)
}
// [END setting_port]
// [END gae_go111_setting_port]
}

// [END main_func]
// [END gae_go111_main_func]

// [START gae_go111_indexHandler]
// [START indexHandler]

// indexHandler responds to requests with our greeting.
func indexHandler(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/" {
Expand All @@ -63,7 +45,3 @@ func indexHandler(w http.ResponseWriter, r *http.Request) {
}
fmt.Fprint(w, "Hello, World!")
}

// [END indexHandler]
// [END gae_go111_indexHandler]
// [END gae_go111_app]
3 changes: 0 additions & 3 deletions bigtable/writes/write_aggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
// Package writes contains snippets related to writing to Cloud Bigtable.
package writes

// [START bigtable_writes_aggregate]
import (
"context"
"fmt"
Expand Down Expand Up @@ -55,5 +54,3 @@ func writeAggregate(w io.Writer, projectID, instanceID string, tableName string)
fmt.Fprintf(w, "Successfully wrote row: %s\n", rowKey)
return nil
}

// [END bigtable_writes_aggregate]
24 changes: 0 additions & 24 deletions jobs/v3/howto/basic_job_sample.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import (
talent "google.golang.org/api/jobs/v3"
)

// [START job_create_job]

// createJob create a job as given.
func createJob(w io.Writer, projectID string, jobToCreate *talent.Job) (*talent.Job, error) {
ctx := context.Background()
Expand All @@ -51,10 +49,6 @@ func createJob(w io.Writer, projectID string, jobToCreate *talent.Job) (*talent.
return job, err
}

// [END job_create_job]

// [START job_get_job]

// getJob gets a job by name.
func getJob(w io.Writer, jobName string) (*talent.Job, error) {
ctx := context.Background()
Expand All @@ -79,10 +73,6 @@ func getJob(w io.Writer, jobName string) (*talent.Job, error) {
return job, err
}

// [END job_get_job]

// [START job_update_job]

// updateJob update a job with all fields except name.
func updateJob(w io.Writer, jobName string, jobToUpdate *talent.Job) (*talent.Job, error) {
ctx := context.Background()
Expand All @@ -108,10 +98,6 @@ func updateJob(w io.Writer, jobName string, jobToUpdate *talent.Job) (*talent.Jo
return job, err
}

// [END job_update_job]

// [START job_update_job_with_field_mask]

// updateJobWithMask updates a job by name with specific fields.
// mask is a comma separated list top-level fields of talent.Job.
func updateJobWithMask(w io.Writer, jobName string, mask string, jobToUpdate *talent.Job) (*talent.Job, error) {
Expand Down Expand Up @@ -139,10 +125,6 @@ func updateJobWithMask(w io.Writer, jobName string, mask string, jobToUpdate *ta
return job, err
}

// [END job_update_job_with_field_mask]

// [START job_delete_job]

// deleteJob deletes an existing job by name.
func deleteJob(w io.Writer, jobName string) error {
ctx := context.Background()
Expand All @@ -164,10 +146,6 @@ func deleteJob(w io.Writer, jobName string) error {
return err
}

// [END job_delete_job]

// [START job_list_jobs]

// listJobs lists jobs with a filter, for example
// `companyName="projects/my-project/companies/123"`.
func listJobs(w io.Writer, projectID, filter string) (*talent.ListJobsResponse, error) {
Expand Down Expand Up @@ -196,5 +174,3 @@ func listJobs(w io.Writer, projectID, filter string) (*talent.ListJobsResponse,

return resp, err
}

// [END job_list_jobs]
3 changes: 0 additions & 3 deletions kms/check_state_import_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

package kms

// [START kms_check_state_import_job]
import (
"context"
"fmt"
Expand Down Expand Up @@ -46,5 +45,3 @@ func checkStateImportJob(w io.Writer, name string) error {
fmt.Fprintf(w, "Current state of import job %q: %s\n", result.Name, result.State)
return nil
}

// [END kms_check_state_import_job]
4 changes: 0 additions & 4 deletions vision/detect/detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ func init() {
_ = os.Open
}

// [START vision_face_detection]

// detectFaces gets faces from the Vision API for an image at the given file path.
func detectFaces(w io.Writer, file string) error {
ctx := context.Background()
Expand Down Expand Up @@ -72,8 +70,6 @@ func detectFaces(w io.Writer, file string) error {
return nil
}

// [END vision_face_detection]

// [START vision_label_detection]

// detectLabels gets labels from the Vision API for an image at the given file path.
Expand Down
Loading