added user independent sections and started db migration work

This commit is contained in:
ston1th 2019-03-26 23:55:55 +01:00
commit 16ea95bf09
24 changed files with 622 additions and 122 deletions

View file

@ -47,8 +47,8 @@ func StoreTitle(section, title string) string {
return section + "/" + title
}
func UnstoreTitle(storeTitle string) (section, title string) {
if a := strings.Split(storeTitle, "/"); len(a) == 2 {
func SplitStoreTitle(st string) (section, title string) {
if a := strings.Split(st, "/"); len(a) == 2 {
return a[0], a[1]
}
return

View file

@ -15,8 +15,8 @@ func TestTitleFunctions(t *testing.T) {
t.Fail()
}
})
t.Run("UnstoreTitle", func(t *testing.T) {
se, ti := UnstoreTitle(combined)
t.Run("SplitStoreTitle", func(t *testing.T) {
se, ti := SplitStoreTitle(combined)
if se != section || ti != title {
t.Fail()
}