Skip to content

Commit

Permalink
chore(ci): run with latest goimports (GoogleCloudPlatform#2680)
Browse files Browse the repository at this point in the history
  • Loading branch information
enocom authored Aug 9, 2022
1 parent 6f68c4b commit 8fd0be9
Show file tree
Hide file tree
Showing 30 changed files with 90 additions and 152 deletions.
17 changes: 17 additions & 0 deletions .github/header-checker-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
allowedCopyrightHolders:
- 'Google LLC'
allowedLicenses:
- 'Apache-2.0'
sourceFileExtensions:
- 'go'
- 'proto'
ignoreFiles:
# These files are based off the gRPC samples, and are under a BSD license.
- "endpoints/getting-started-grpc/client/main.go"
- "endpoints/getting-started-grpc/server/main.go"
- "endpoints/getting-started-grpc/helloworld/helloworld.pb.go"
# Generated .pg.go files.
- "bigquery/snippets/managedwriter/exampleproto/sample_data.pb.go"
- "profiler/shakesapp/shakesapp/shakesapp.pb.go"
- "run/grpc-ping/pkg/api/v1/message.pb.go"
- "run/grpc-server-streaming/pkg/api/v1/timeservice.pb.go"
2 changes: 1 addition & 1 deletion bigtable/garbagecollection/create_family_gc_intersect.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion bigtable/garbagecollection/create_family_gc_max_age.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion bigtable/garbagecollection/create_family_gc_nested.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion bigtable/garbagecollection/create_family_gc_union.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
16 changes: 8 additions & 8 deletions bigtable/search/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
// Search is a sample web server that uses Cloud Bigtable as the storage layer
// for a simple document-storage and full-text-search service.
// It has four functions:
// - Initialize and clear the table.
// - Add a document. This adds the content of a user-supplied document to the
// Bigtable, and adds references to the document to an index in the Bigtable.
// The document is indexed under each unique word in the document.
// - Search the index. This returns documents containing each word in a user
// query, with snippets and links to view the whole document.
// - Copy table. This copies the documents and index from another table and
// adds them to the current one.
// - Initialize and clear the table.
// - Add a document. This adds the content of a user-supplied document to the
// Bigtable, and adds references to the document to an index in the Bigtable.
// The document is indexed under each unique word in the document.
// - Search the index. This returns documents containing each word in a user
// query, with snippets and links to view the whole document.
// - Copy table. This copies the documents and index from another table and
// adds them to the current one.
package main

import (
Expand Down
2 changes: 1 addition & 1 deletion cdn/signedcookies/sign_cookie_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion cdn/signedurls/signurl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion compute/quickstart/compute_quickstart_sample.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion compute/quickstart/compute_quickstart_sample_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
7 changes: 4 additions & 3 deletions dataproc/quickstart/quickstart.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
// and finally delete the cluster.
//
// Usage:
// go build
// ./quickstart --project_id <PROJECT_ID> --region <REGION> \
// --cluster_name <CLUSTER_NAME> --job_file_path <GCS_JOB_FILE_PATH>
//
// go build
// ./quickstart --project_id <PROJECT_ID> --region <REGION> \
// --cluster_name <CLUSTER_NAME> --job_file_path <GCS_JOB_FILE_PATH>
package main

import (
Expand Down
8 changes: 4 additions & 4 deletions docs/appengine/storage/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func handler(w http.ResponseWriter, r *http.Request) {
}
}

//[START write]
// [START write]
// createFile creates a file in Google Cloud Storage.
func (d *demo) createFile(fileName string) {
fmt.Fprintf(d.w, "Creating file /%v/%v\n", d.bucketName, fileName)
Expand Down Expand Up @@ -155,7 +155,7 @@ func (d *demo) createFile(fileName string) {

//[END write]

//[START read]
// [START read]
// readFile reads the named file in Google Cloud Storage.
func (d *demo) readFile(fileName string) {
io.WriteString(d.w, "\nAbbreviated file content (first line and last 1K):\n")
Expand All @@ -182,7 +182,7 @@ func (d *demo) readFile(fileName string) {

//[END read]

//[START copy]
// [START copy]
// copyFile copies a file in Google Cloud Storage.
func (d *demo) copyFile(fileName string) {
copyName := fileName + "-copy"
Expand Down Expand Up @@ -239,7 +239,7 @@ func (d *demo) createListFiles() {
}
}

//[START list_bucket]
// [START list_bucket]
// listBucket lists the contents of a bucket in Google Cloud Storage.
func (d *demo) listBucket() {
io.WriteString(d.w, "\nListbucket result:\n")
Expand Down
2 changes: 2 additions & 0 deletions endpoints/getting-started-grpc/helloworld/helloworld.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion getting-started/gopher-run/generator/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
89 changes: 0 additions & 89 deletions header_test.go

This file was deleted.

30 changes: 15 additions & 15 deletions internal/aeintegrate/aeintegrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@
//
// Sample usage with `go test`:
//
// package myapp
// package myapp
//
// import (
// "testing"
// "google.golang.org/appengine/aeintegrate"
// )
// import (
// "testing"
// "google.golang.org/appengine/aeintegrate"
// )
//
// func TestApp(t *testing.T) {
// t.Parallel()
// app := aeintegrate.App{Name: "A", Dir: "app"},
// if err := app.Deploy(); err != nil {
// t.Fatalf("could not deploy app: %v", err)
// }
// defer app.Cleanup()
// resp, err := app.Get("/")
// ...
// }
// func TestApp(t *testing.T) {
// t.Parallel()
// app := aeintegrate.App{Name: "A", Dir: "app"},
// if err := app.Deploy(); err != nil {
// t.Fatalf("could not deploy app: %v", err)
// }
// defer app.Cleanup()
// resp, err := app.Get("/")
// ...
// }
package aeintegrate

import (
Expand Down
20 changes: 10 additions & 10 deletions internal/cleanaeversions/cleanaeversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@

// Command cleaneversions deletes App Engine versions for a given project, service and/or version ID filter.
//
// Usage of cleanaeversions:
// -async
// Don't wait for successful deletion.
// -filter regexp
// Filter regexp for version IDs. If empty, attempts to clean all versions.
// -n Dry run.
// -project Project ID
// Project ID to clean.
// -service Service/module ID
// Service/module ID to clean. If omitted, cleans all services.
// Usage of cleanaeversions:
// -async
// Don't wait for successful deletion.
// -filter regexp
// Filter regexp for version IDs. If empty, attempts to clean all versions.
// -n Dry run.
// -project Project ID
// Project ID to clean.
// -service Service/module ID
// Service/module ID to clean. If omitted, cleans all services.
package main

import (
Expand Down
2 changes: 1 addition & 1 deletion jobs/v3/howto/general_search_sample.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func employmentTypesSearch(w io.Writer, projectID, companyName string, employmen

// [START date_range_filter]

///dateRangeSearch searches for jobs on date range.
// /dateRangeSearch searches for jobs on date range.
// In JSON format, the Timestamp type is encoded as a string in the
// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
Expand Down
2 changes: 1 addition & 1 deletion mediacdn/sign_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion monitoring/prometheus/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion opentelemetry/trace/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
Loading

0 comments on commit 8fd0be9

Please sign in to comment.