2024-12-03 09:19:38 +01:00
|
|
|
package models
|
|
|
|
|
|
|
|
type Profile struct {
|
|
|
|
ProfileItems []string
|
|
|
|
Max int
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *Profile) InsertOrShift(index int, value string) {
|
|
|
|
if index < len(p.ProfileItems) {
|
|
|
|
p.ProfileItems = append(p.ProfileItems[:index], value)
|
|
|
|
} else {
|
2024-12-03 12:37:55 +01:00
|
|
|
for len(p.ProfileItems) < index {
|
|
|
|
p.ProfileItems = append(p.ProfileItems, "0")
|
|
|
|
}
|
|
|
|
p.ProfileItems = append(p.ProfileItems, "0")
|
|
|
|
p.ProfileItems[index] = value
|
2024-12-03 09:19:38 +01:00
|
|
|
}
|
|
|
|
}
|