You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by lo...@apache.org on 2022/06/29 16:34:24 UTC

[beam] branch master updated: [Go SDK] Go Lint fixes (#21967)

This is an automated email from the ASF dual-hosted git repository.

lostluck pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new ffa46b330fb [Go SDK] Go Lint fixes  (#21967)
ffa46b330fb is described below

commit ffa46b330fb62d49baa3c7afc9c9cd89384ad774
Author: Ritesh Ghorse <ri...@gmail.com>
AuthorDate: Wed Jun 29 12:34:17 2022 -0400

    [Go SDK] Go Lint fixes  (#21967)
---
 sdks/go/test/integration/io/fhirio/fhirio_test.go      | 12 ++++++------
 .../integration/io/xlang/bigquery/bigquery_test.go     | 18 +++++++++---------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/sdks/go/test/integration/io/fhirio/fhirio_test.go b/sdks/go/test/integration/io/fhirio/fhirio_test.go
index 560e74f4522..b9274598f5a 100644
--- a/sdks/go/test/integration/io/fhirio/fhirio_test.go
+++ b/sdks/go/test/integration/io/fhirio/fhirio_test.go
@@ -104,13 +104,13 @@ func setupFhirStore(t *testing.T, shouldPopulateStore bool) (string, []string, f
 
 func createStore(dataset string) (*healthcare.FhirStore, error) {
 	randInt, _ := rand.Int(rand.Reader, big.NewInt(32))
-	testFhirStoreId := "FHIR_store_write_it_" + strconv.FormatInt(time.Now().UnixMilli(), 10) + "_" + randInt.String()
+	testFhirStoreID := "FHIR_store_write_it_" + strconv.FormatInt(time.Now().UnixMilli(), 10) + "_" + randInt.String()
 	fhirStore := &healthcare.FhirStore{
 		DisableReferentialIntegrity: true,
 		EnableUpdateCreate:          true,
 		Version:                     "R4",
 	}
-	return storeManagementService.Create(dataset, fhirStore).FhirStoreId(testFhirStoreId).Do()
+	return storeManagementService.Create(dataset, fhirStore).FhirStoreId(testFhirStoreID).Do()
 }
 
 func deleteStore(storePath string) (*healthcare.Empty, error) {
@@ -165,16 +165,16 @@ func readPrettyBundles() [][]byte {
 	return bundles
 }
 
-func extractResourcePathFrom(resourceLocationUrl string) (string, error) {
+func extractResourcePathFrom(resourceLocationURL string) (string, error) {
 	// The resource location url is in the following format:
 	// https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/STORE_ID/fhir/RESOURCE_NAME/RESOURCE_ID/_history/HISTORY_ID
 	// But the API calls use this format: projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/STORE_ID/fhir/RESOURCE_NAME/RESOURCE_ID
-	startIdx := strings.Index(resourceLocationUrl, "projects/")
-	endIdx := strings.Index(resourceLocationUrl, "/_history")
+	startIdx := strings.Index(resourceLocationURL, "projects/")
+	endIdx := strings.Index(resourceLocationURL, "/_history")
 	if startIdx == -1 || endIdx == -1 {
 		return "", errors.New("resource location url is invalid")
 	}
-	return resourceLocationUrl[startIdx:endIdx], nil
+	return resourceLocationURL[startIdx:endIdx], nil
 }
 
 func TestFhirIO_Read(t *testing.T) {
diff --git a/sdks/go/test/integration/io/xlang/bigquery/bigquery_test.go b/sdks/go/test/integration/io/xlang/bigquery/bigquery_test.go
index 0f7516d1986..ca60a5b8677 100644
--- a/sdks/go/test/integration/io/xlang/bigquery/bigquery_test.go
+++ b/sdks/go/test/integration/io/xlang/bigquery/bigquery_test.go
@@ -69,8 +69,8 @@ const (
 // and random data in different data types to provide a reasonable signal that reading and writing
 // works at a basic level.
 type TestRow struct {
-	Counter   int64    `beam:"counter"`   // A deterministic counter, increments for each row generated.
-	Rand_data RandData `beam:"rand_data"` // An inner struct containing randomized data.
+	Counter  int64    `beam:"counter"`   // A deterministic counter, increments for each row generated.
+	RandData RandData `beam:"rand_data"` // An inner struct containing randomized data.
 }
 
 func shuffleText() []string {
@@ -106,7 +106,7 @@ func (fn *CreateTestRowsFn) ProcessElement(_ []byte, emit func(TestRow)) {
 	for i := 0; i < inputSize; i++ {
 		emit(TestRow{
 			Counter: int64(i),
-			Rand_data: RandData{
+			RandData: RandData{
 				Flip: rand.Int63n(2) != 0,
 				Num:  rand.Int63(),
 				Word: words[i],
@@ -151,8 +151,8 @@ func ReadPipeline(expansionAddr, table string, createFn interface{}) *beam.Pipel
 //
 // TODO(https://github.com/apache/beam/issues/21784): Change back to a named struct once resolved.
 type TestRowPtrs = struct {
-	Counter   *int64        `beam:"counter"`
-	Rand_data *RandDataPtrs `beam:"rand_data"`
+	Counter  *int64        `beam:"counter"`
+	RandData *RandDataPtrs `beam:"rand_data"`
 }
 
 // RandDataPtrs is equivalent to RandData but all fields are pointers, meant to be used when reading
@@ -170,10 +170,10 @@ type RandDataPtrs = struct {
 func castFn(elm TestRowPtrs) TestRow {
 	return TestRow{
 		Counter: *elm.Counter,
-		Rand_data: RandData{
-			Flip: *elm.Rand_data.Flip,
-			Num:  *elm.Rand_data.Num,
-			Word: *elm.Rand_data.Word,
+		RandData: RandData{
+			Flip: *elm.RandData.Flip,
+			Num:  *elm.RandData.Num,
+			Word: *elm.RandData.Word,
 		},
 	}
 }