chore: fix usage bug
This commit is contained in:
parent
73eaac5bc6
commit
fc200cf84f
@ -203,14 +203,13 @@ func addKey(preamble lextwt.Comments, key, value string, v ...any) lextwt.Commen
|
|||||||
}
|
}
|
||||||
|
|
||||||
func mkPreamble(hostname, uri, path string, limit int, length, offset, end int64) lextwt.Comments {
|
func mkPreamble(hostname, uri, path string, limit int, length, offset, end int64) lextwt.Comments {
|
||||||
hostname += path
|
|
||||||
preamble := addKey(mkPreambleDocs(hostname), "twt range", "1 %d", end)
|
preamble := addKey(mkPreambleDocs(hostname), "twt range", "1 %d", end)
|
||||||
preamble = addKey(preamble, "self", "%s%s", hostname, mkqry(uri, limit, offset))
|
preamble = addKey(preamble, "self", "%s%s%s", hostname, path, mkqry(uri, limit, offset))
|
||||||
if next := offset + length; next < end {
|
if next := offset + length; next < end {
|
||||||
preamble = addKey(preamble, "next", "%s%s", hostname, mkqry(uri, limit, next))
|
preamble = addKey(preamble, "next", "%s%s%s", hostname, path, mkqry(uri, limit, next))
|
||||||
}
|
}
|
||||||
if prev := offset - int64(limit); prev > 0 {
|
if prev := offset - int64(limit); prev > 0 {
|
||||||
preamble = addKey(preamble, "prev", "%s%s", hostname, mkqry(uri, limit, prev))
|
preamble = addKey(preamble, "prev", "%s%s%s", hostname, path, mkqry(uri, limit, prev))
|
||||||
}
|
}
|
||||||
return preamble
|
return preamble
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user