Skip to content

Commit

Permalink
Added panic warning for nil values
Browse files Browse the repository at this point in the history
  • Loading branch information
Rens Rikkerink authored and ikkerens committed Mar 5, 2019
1 parent f374248 commit 1b95e53
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ Originally this package was made as an extension to binary.Read and binary.Write
The types `int` and `uint` are not supported because their actual sizes depend on the compiler architecture.
Instead, be explicit and use int32/int64/uint32/uint64.

#### Note about nil values
This lib will initialize nil values when Unpacking/Unmarshalling, however it will panic if a nil value is attempted to be Packed/Serialized.
This is due to the fact that there is no safe way to distinguish nil pointers from zero values.
Be safe, don't try to serialize nil values.

## Include in your project
```go
import "github.com/ikkerens/ikeapack"
Expand Down

0 comments on commit 1b95e53

Please sign in to comment.