Skip to content

Commit

Permalink
Merge pull request #5 from oscarbailey-tc/more-examples
Browse files Browse the repository at this point in the history
Add more examples to README
  • Loading branch information
gagliardetto committed Apr 13, 2022
2 parents 8f1059c + e0238b5 commit 990fbf1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Expand Up @@ -63,3 +63,25 @@ enum MyEnum {
}
```

### Exported vs Unexported Fields

In this example, the `two` field will be skipped by the encoder/decoder because the
field is not exported.
```golang
type MyStruct struct {
One string
two uint32
Three int16
}
```

### Skip Decoding/Encoding Attributes

Encoding/Decoding of exported fields can be skipped using the `borsh_skip` tag.
```golang
type MyStruct struct {
One string
Two uint32 `borsh_skip:"true"`
Three int16
}
```

0 comments on commit 990fbf1

Please sign in to comment.