added user independent sections and started db migration work
This commit is contained in:
parent
6a2dc8146c
commit
16ea95bf09
24 changed files with 622 additions and 122 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue