-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
chore(gae): migrate region tags from projectionqueries.go #5108
Changes from 1 commit
1669a27
0d9a4b6
d0a66bd
f827d0d
db4c14f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -28,13 +28,16 @@ type EventLog struct { | |||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
func example() { | ||||||||||||||||||||||||||||||
// [START gae_datastore_using_1] | ||||||||||||||||||||||||||||||
// [START using_1] | ||||||||||||||||||||||||||||||
q := datastore.NewQuery("People").Project("FirstName", "LastName") | ||||||||||||||||||||||||||||||
// [END using_1] | ||||||||||||||||||||||||||||||
// [END gae_datastore_using_1] | ||||||||||||||||||||||||||||||
_ = q | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
func example2() { | ||||||||||||||||||||||||||||||
// [START gae_datastore_using_2] | ||||||||||||||||||||||||||||||
// [START using_2] | ||||||||||||||||||||||||||||||
q := datastore.NewQuery("EventLog"). | ||||||||||||||||||||||||||||||
Project("Title", "ReadPath", "DateWritten"). | ||||||||||||||||||||||||||||||
|
@@ -53,31 +56,38 @@ func example2() { | |||||||||||||||||||||||||||||
log.Infof(ctx, "Log record: %v, %v, %v", l.Title, l.ReadPath, l.DateWritten) | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
// [END using_2] | ||||||||||||||||||||||||||||||
// [END gae_datastore_using_2] | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
func example3() { | ||||||||||||||||||||||||||||||
// [START gae_grouping_grouping] | ||||||||||||||||||||||||||||||
// [START grouping] | ||||||||||||||||||||||||||||||
q := datastore.NewQuery("Person"). | ||||||||||||||||||||||||||||||
Project("LastName", "Height").Distinct(). | ||||||||||||||||||||||||||||||
Filter("Height >", 20). | ||||||||||||||||||||||||||||||
Order("-Height").Order("LastName") | ||||||||||||||||||||||||||||||
// [END grouping] | ||||||||||||||||||||||||||||||
// [END gae_grouping_grouping] | ||||||||||||||||||||||||||||||
Comment on lines
+63
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The region tags // [START gae_datastore_grouping]
q := datastore.NewQuery("Person").
Project("LastName", "Height").Distinct().
Filter("Height >", 20).
Order("-Height").Order("LastName")
// [END gae_datastore_grouping]
Suggested change
|
||||||||||||||||||||||||||||||
_ = q | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
type Foo struct { | ||||||||||||||||||||||||||||||
A []int | ||||||||||||||||||||||||||||||
B []string | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
// [START gae_datastore_projections_and_multiple_valued_properties_1] | ||||||||||||||||||||||||||||||
// [START projections_and_multiple_valued_properties_1] | ||||||||||||||||||||||||||||||
entity := Foo{A: []int{1, 1, 2, 3}, B: []string{"x", "y", "x"}} | ||||||||||||||||||||||||||||||
// [END projections_and_multiple_valued_properties_1] | ||||||||||||||||||||||||||||||
// [END gae_datastore_projections_and_multiple_valued_properties_1] | ||||||||||||||||||||||||||||||
Comment on lines
+78
to
+82
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we consolidate the region tags here as well, similar to the previous suggestions? Using a single tag // [START gae_datastore_projections_and_multiple_valued_properties_1]
entity := Foo{A: []int{1, 1, 2, 3}, B: []string{"x", "y", "x"}}
// [END gae_datastore_projections_and_multiple_valued_properties_1]
Suggested change
|
||||||||||||||||||||||||||||||
_ = entity | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
func example4() { | ||||||||||||||||||||||||||||||
// [START gae_datastore_projections_and_multiple_valued_properties_2] | ||||||||||||||||||||||||||||||
// [START projections_and_multiple_valued_properties_2] | ||||||||||||||||||||||||||||||
q := datastore.NewQuery("Foo").Project("A", "B").Filter("A <", 3) | ||||||||||||||||||||||||||||||
// [END projections_and_multiple_valued_properties_2] | ||||||||||||||||||||||||||||||
// [END gae_datastore_projections_and_multiple_valued_properties_2] | ||||||||||||||||||||||||||||||
Comment on lines
+87
to
+91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For consistency, let's consolidate the tags // [START gae_datastore_projections_and_multiple_valued_properties_2]
q := datastore.NewQuery("Foo").Project("A", "B").Filter("A <", 3)
// [END gae_datastore_projections_and_multiple_valued_properties_2]
Suggested change
|
||||||||||||||||||||||||||||||
_ = q | ||||||||||||||||||||||||||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we consolidate the start and end tags for
gae_datastore_using_1
andusing_1
into a single tag? This would reduce redundancy and improve readability. For example: