Debian Codegraph @

internal/redirect/legacy.go

raw symbols SCIP
1 package redirectscip-go gomod github.com/Debian/debiman . `github.com/Debian/debiman/internal/redirect`/
2
3 import "stringsscip-go gomod github.com/golang/go/src go1.13 strings/"
4
5 func (i *Indexscip-go gomod github.com/Debian/debiman . `github.com/Debian/debiman/internal/redirect`/Index#) splitLegacyscip-go gomod github.com/Debian/debiman . `github.com/Debian/debiman/internal/redirect`/Index#splitLegacy().(path string) (suite string, binarypkg string, name string, section string, lang string) {
6 parts := stringsscip-go gomod github.com/golang/go/src go1.13 strings/.Splitscip-go gomod github.com/golang/go/src go1.13 strings/Split().(path[1:], "/")
7 // /man/<name>
8 // /man<section>/<name>
9 if len(parts) == 2 {
10 return "", "", parts[1], parts[0][len("man"):], ""
11 }
12 // /man/<section>/<name>
13 // /man/<lang>/<name>
14 if len(parts) == 3 {
15 if i.Langsscip-go gomod github.com/Debian/debiman . `github.com/Debian/debiman/internal/redirect`/Index#Langs.[parts[1]] {
16 return "", "", parts[2], "", parts[1]
17 } else if i.Sectionsscip-go gomod github.com/Debian/debiman . `github.com/Debian/debiman/internal/redirect`/Index#Sections.[parts[1]] {
18 return "", "", parts[2], parts[1], ""
19 }
20 }
21 // /man/<suite>/<section>/<name>
22 if len(parts) == 4 {
23 return parts[1], "", parts[3], parts[2], ""
24 }
25 // /man/<suite>/<lang>/<section>/<name>
26 if len(parts) == 5 {
27 return parts[1], "", parts[4], parts[3], parts[2]
28 }
29 return "", "", "", "", ""
30 }