Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion db/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func TestNewClient(t *testing.T) {
func TestNewClientAuthOverrides(t *testing.T) {
cases := []map[string]interface{}{
nil,
map[string]interface{}{"uid": "user1"},
{"uid": "user1"},
}
for _, tc := range cases {
c, err := NewClient(context.Background(), &internal.DatabaseConfig{
Expand Down
2 changes: 1 addition & 1 deletion db/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func (q *queryNodeImpl) Key() string {
if q.CompKey.Str != nil {
return *q.CompKey.Str
}
// Numeric keys in queryNodeImpl are always array indices, and can be safely coverted into int.
// Numeric keys in queryNodeImpl are always array indices, and can be safely converted into int.
return strconv.Itoa(int(*q.CompKey.Num))
}

Expand Down
22 changes: 11 additions & 11 deletions db/ref_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,12 @@ func TestGetIfChanged(t *testing.T) {
}

checkAllRequests(t, mock.Reqs, []*testReq{
&testReq{
{
Method: "GET",
Path: "/peter.json",
Header: http.Header{"If-None-Match": []string{"old-etag"}},
},
&testReq{
{
Method: "GET",
Path: "/peter.json",
Header: http.Header{"If-None-Match": []string{"new-etag"}},
Expand Down Expand Up @@ -513,7 +513,7 @@ func TestInvalidUpdate(t *testing.T) {
cases := []map[string]interface{}{
nil,
make(map[string]interface{}),
map[string]interface{}{"foo": func() {}},
{"foo": func() {}},
}
for _, tc := range cases {
if err := testref.Update(context.Background(), tc); err == nil {
Expand Down Expand Up @@ -542,12 +542,12 @@ func TestTransaction(t *testing.T) {
t.Fatal(err)
}
checkAllRequests(t, mock.Reqs, []*testReq{
&testReq{
{
Method: "GET",
Path: "/peter.json",
Header: http.Header{"X-Firebase-ETag": []string{"true"}},
},
&testReq{
{
Method: "PUT",
Path: "/peter.json",
Body: serialize(map[string]interface{}{
Expand Down Expand Up @@ -591,12 +591,12 @@ func TestTransactionRetry(t *testing.T) {
t.Errorf("Transaction() retries = %d; want = %d", cnt, 2)
}
checkAllRequests(t, mock.Reqs, []*testReq{
&testReq{
{
Method: "GET",
Path: "/peter.json",
Header: http.Header{"X-Firebase-ETag": []string{"true"}},
},
&testReq{
{
Method: "PUT",
Path: "/peter.json",
Body: serialize(map[string]interface{}{
Expand All @@ -605,7 +605,7 @@ func TestTransactionRetry(t *testing.T) {
}),
Header: http.Header{"If-Match": []string{"mock-etag1"}},
},
&testReq{
{
Method: "PUT",
Path: "/peter.json",
Body: serialize(map[string]interface{}{
Expand Down Expand Up @@ -650,12 +650,12 @@ func TestTransactionError(t *testing.T) {
t.Errorf("Transaction() retries = %d; want = %d", cnt, 1)
}
checkAllRequests(t, mock.Reqs, []*testReq{
&testReq{
{
Method: "GET",
Path: "/peter.json",
Header: http.Header{"X-Firebase-ETag": []string{"true"}},
},
&testReq{
{
Method: "PUT",
Path: "/peter.json",
Body: serialize(map[string]interface{}{
Expand Down Expand Up @@ -694,7 +694,7 @@ func TestTransactionAbort(t *testing.T) {
t.Errorf("Transaction() = nil; want error")
}
wanted := []*testReq{
&testReq{
{
Method: "GET",
Path: "/peter.json",
Header: http.Header{"X-Firebase-ETag": []string{"true"}},
Expand Down
4 changes: 2 additions & 2 deletions firebase_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ func TestDatabase(t *testing.T) {
func TestDatabaseAuthOverrides(t *testing.T) {
cases := []map[string]interface{}{
nil,
map[string]interface{}{},
map[string]interface{}{"uid": "user1"},
{},
{"uid": "user1"},
}
for _, tc := range cases {
ctx := context.Background()
Expand Down
4 changes: 2 additions & 2 deletions snippets/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ func setValue(ctx context.Context, ref *db.Ref) {
// [START set_value]
usersRef := ref.Child("users")
err := usersRef.Set(ctx, map[string]*User{
"alanisawesome": &User{
"alanisawesome": {
DateOfBirth: "June 23, 1912",
FullName: "Alan Turing",
},
"gracehop": &User{
"gracehop": {
DateOfBirth: "December 9, 1906",
FullName: "Grace Hopper",
},
Expand Down