profile-edit-traverse #199
14
models/profile.go
Normal file
14
models/profile.go
Normal file
@ -0,0 +1,14 @@
|
||||
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 {
|
||||
p.ProfileItems = append(p.ProfileItems, value)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user