Skip to content

Commit

Permalink
chore(firestore): enable Go 1.13 error wrapping (#6727)
Browse files Browse the repository at this point in the history
  • Loading branch information
quartzmo committed Sep 26, 2022
1 parent 0e44369 commit abb6ec8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion firestore/client.go
Expand Up @@ -104,7 +104,7 @@ func NewClient(ctx context.Context, projectID string, opts ...option.ClientOptio
func detectProjectID(ctx context.Context, opts ...option.ClientOption) (string, error) {
creds, err := transport.Creds(ctx, opts...)
if err != nil {
return "", fmt.Errorf("fetching creds: %v", err)
return "", fmt.Errorf("fetching creds: %w", err)
}
if creds.ProjectID == "" {
return "", errors.New("firestore: see the docs on DetectProjectID")
Expand Down
2 changes: 1 addition & 1 deletion firestore/collgroupref.go
Expand Up @@ -109,7 +109,7 @@ func (cgr CollectionGroupRef) getPartitions(ctx context.Context, partitionCount
break
}
if err != nil {
return nil, fmt.Errorf("GetPartitions: %v", err)
return nil, fmt.Errorf("GetPartitions: %w", err)
}
cursorReferences = append(cursorReferences, cursor.GetValues()...)
}
Expand Down
2 changes: 1 addition & 1 deletion firestore/from_value.go
Expand Up @@ -340,7 +340,7 @@ func populateStruct(vs reflect.Value, pm map[string]*pb.Value, c *Client) error
vproto := v.vproto

if err := setReflectFromProtoValue(vs.FieldByIndex(f.Index), vproto, c); err != nil {
return fmt.Errorf("%s.%s: %v", vs.Type(), f.Name, err)
return fmt.Errorf("%s.%s: %w", vs.Type(), f.Name, err)
}
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion firestore/to_value.go
Expand Up @@ -258,7 +258,7 @@ type tagOptions struct {
func parseTag(t reflect.StructTag) (name string, keep bool, other interface{}, err error) {
name, keep, opts, err := fields.ParseStandardTag("firestore", t)
if err != nil {
return "", false, nil, fmt.Errorf("firestore: %v", err)
return "", false, nil, fmt.Errorf("firestore: %w", err)
}
tagOpts := tagOptions{}
for _, opt := range opts {
Expand Down

0 comments on commit abb6ec8

Please sign in to comment.