mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-26 14:46:24 -07:00
Start adding template function tests
This commit is contained in:
parent
e5bbcc6493
commit
34e6887490
2 changed files with 71 additions and 6 deletions
|
@ -12,11 +12,8 @@ import (
|
|||
)
|
||||
|
||||
func banMaskTmplFunc(ban gcsql.IPBan) string {
|
||||
if ban.ID < 1 {
|
||||
if ban.RangeStart == ban.RangeEnd {
|
||||
return ban.RangeStart
|
||||
}
|
||||
return ""
|
||||
if ban.RangeStart == ban.RangeEnd {
|
||||
return ban.RangeStart
|
||||
}
|
||||
ipn, err := gcutil.GetIPRangeSubnet(ban.RangeStart, ban.RangeEnd)
|
||||
if err != nil {
|
||||
|
@ -69,7 +66,7 @@ func getTopPostIDTmplFunc(post *gcsql.Post) int {
|
|||
return id
|
||||
}
|
||||
|
||||
func numRepliesTmplFunc(boardid, opID int) int {
|
||||
func numRepliesTmplFunc(_, opID int) int {
|
||||
num, err := gcsql.GetThreadReplyCountFromOP(opID)
|
||||
if err != nil {
|
||||
return 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue