Skip to content

Commit

Permalink
Fix examples in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hibiken committed Jul 18, 2021
1 parent 684a7e0 commit bff2a05
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ type ImageResizePayload struct {
//----------------------------------------------

func NewEmailDeliveryTask(userID int, tmplID string) (*asynq.Task, error) {
payload, err := json.Marshal(EmailDeliveryPayload{UserID: userID, TemplateID: templID})
payload, err := json.Marshal(EmailDeliveryPayload{UserID: userID, TemplateID: tmplID})
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -129,7 +129,7 @@ type ImageProcessor struct {
// ... fields for struct
}

func (p *ImageProcessor) ProcessTask(ctx context.Context, t *asynq.Task) error {
func (processor *ImageProcessor) ProcessTask(ctx context.Context, t *asynq.Task) error {
var p ImageResizePayload
if err := json.Unmarshal(t.Payload(), &p); err != nil {
return fmt.Errorf("json.Unmarshal failed: %v: %w", err, asynq.SkipRetry)
Expand All @@ -140,7 +140,7 @@ func (p *ImageProcessor) ProcessTask(ctx context.Context, t *asynq.Task) error {
}

func NewImageProcessor() *ImageProcessor {
// ... return an instance
return &ImageProcessor{}
}
```

Expand Down

0 comments on commit bff2a05

Please sign in to comment.