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

2 comments on commit bff2a05

@wsqyouth
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, just these two errors, fix well!
i am also a go software engineer in china, can we stduy together?

@hibiken
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! I'm actively working on this package so if you have something you're interested in contributing, feel free to ping me in the discussion or Gitter channel.

Please sign in to comment.