Skip to content

Commit

Permalink
docs(example): unconfuse README fields example
Browse files Browse the repository at this point in the history
  • Loading branch information
myypo committed Dec 8, 2023
1 parent 7956710 commit cb9e313
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,33 @@ To define a pass you use the `Pass` struct, which represents the [pass.json](htt

```go
c := passkit.NewBoardingPass(passkit.TransitTypeAir)
field := passkit.Field{
Key: "key",
Label: "label",
Value:"value",
}

// Utility functions for adding fields to a pass
c.AddHeaderField(field)
c.AddPrimaryFields(field)
c.AddSecondaryFields(field)
c.AddAuxiliaryFields(field)
c.AddBackFields(field)
c.AddHeaderField(passkit.Field{
Key: "your_head_key",
Label: "your_displayable_head_label",
Value:"value",
})
c.AddPrimaryFields(passkit.Field{
Key: "your_prim_key",
Label: "your_displayable_prim_label",
Value:"value",
})
c.AddSecondaryFields(passkit.Field{
Key: "your_sec_key",
Label: "your_displayable_sec_label",
Value:"value",
})
c.AddAuxiliaryFields(passkit.Field{
Key: "your_aux_key",
Label: "your_displayable_aux_label",
Value:"value",
})
c.AddBackFields(passkit.Field{
Key: "your_back_key",
Label: "your_displayable_back_label",
Value:"value",
})

pass := passkit.Pass{
FormatVersion: 1,
Expand Down

0 comments on commit cb9e313

Please sign in to comment.