From 944fa89b3cffdf1ec4a19e0be842678d8d97e3bf Mon Sep 17 00:00:00 2001 From: Carlosokumu Date: Tue, 3 Dec 2024 11:19:38 +0300 Subject: [PATCH] add profile holder struct --- models/profile.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 models/profile.go diff --git a/models/profile.go b/models/profile.go new file mode 100644 index 0000000..bdc1f0d --- /dev/null +++ b/models/profile.go @@ -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) + } +}