forked from urdt/ussd
add profile holder struct
This commit is contained in:
parent
48e1b02e0e
commit
944fa89b3c
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