Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 515 Bytes

File metadata and controls

29 lines (22 loc) · 515 Bytes

SIndex

Slice Indexing library for Golang.

Documentation

https://godoc.org/github.com/timob/sindex

Example

func ExampleList() {
	bytes := []byte("helloworld")
	bl := NewList(&bytes)
	bytes[bl.Insert(5)] = ' '
	bytes[bl.Append()] = '!'

	fmt.Println(string(bytes))

	for iter := bl.Iterator(0); iter.Next(); {
		fmt.Print(string(bytes[iter.Pos()]))
	}
	// Output:
	// hello world!
	// hello world!
}

Projects using this library