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