mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-17 20:44:29 -04:00
style: add comments to the public methods and members in the root package.
This commit is contained in:
2
order.go
2
order.go
@ -6,6 +6,7 @@ package sointu
|
||||
// necessary amount when a new item is added, filling the unused slots with -1s.
|
||||
type Order []int
|
||||
|
||||
// Get returns the value at index; or -1 is the index is out of range
|
||||
func (s Order) Get(index int) int {
|
||||
if index < 0 || index >= len(s) {
|
||||
return -1
|
||||
@ -13,6 +14,7 @@ func (s Order) Get(index int) int {
|
||||
return s[index]
|
||||
}
|
||||
|
||||
// Set sets the value at index; appending -1s until the slice is long enough.
|
||||
func (s *Order) Set(index, value int) {
|
||||
for len(*s) <= index {
|
||||
*s = append(*s, -1)
|
||||
|
Reference in New Issue
Block a user