Added more tests
This commit is contained in:
parent
ec20fd3d3a
commit
b6400cd77e
5 changed files with 42 additions and 33 deletions
|
@ -5,7 +5,8 @@ import "bytes"
|
|||
// Data represents the static read-only data.
|
||||
type Data []byte
|
||||
|
||||
// Add adds the given bytes to the data block and returns the address relative to the start of the data section.
|
||||
// Add adds the given bytes to the data block if this sequence of bytes doesn't exist yet.
|
||||
// It returns the address relative to the start of the data section.
|
||||
func (data *Data) Add(block []byte) Address {
|
||||
position := bytes.Index(*data, block)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue