https://github.com/timob/sindex
Slice indexing library for golang
https://github.com/timob/sindex
Last synced: 5 months ago
JSON representation
Slice indexing library for golang
- Host: GitHub
- URL: https://github.com/timob/sindex
- Owner: timob
- License: bsd-2-clause
- Created: 2016-02-24T19:47:37.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-12-06T08:03:21.000Z (over 5 years ago)
- Last Synced: 2025-08-15T00:16:03.906Z (10 months ago)
- Language: Go
- Size: 18.6 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## SIndex
Slice Indexing library for Golang.
#### Documentation
https://godoc.org/github.com/timob/sindex
#### Example
```go
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
* GNU Ls clone for win/unix https://github.com/timob/ls