Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostiam committed Apr 3, 2024
1 parent 82103a4 commit 601d781
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,13 @@ type test struct {
ValueFromOtherField string `bin:"len:DataLength"`
CalcValueFromOtherField string `bin:"len:DataLength+10"` // also work calculations

// Also supported nested structures.
Inner struct {
DataLength int // actual length for ValueFromInnerField and CalcValueFromInnerField
}
ValueFromInnerField string `bin:"len:Inner.DataLength"`
CalcValueFromInnerField string `bin:"len:Inner.DataLength+10"`

// You can change the byte order directly from the tag
UInt16LE uint16 `bin:"le"`
UInt16BE uint16 `bin:"be"`
Expand Down

0 comments on commit 601d781

Please sign in to comment.