mirror of
https://github.com/mumble-voip/grumble.git
synced 2025-12-20 06:10:00 -08:00
Fix function comments based on best practices from Effective Go
Signed-off-by: CodeLingo Bot <bot@codelingo.io>
This commit is contained in:
parent
503d18a608
commit
eb02aadf56
11 changed files with 76 additions and 76 deletions
|
|
@ -41,7 +41,7 @@ func (ban Ban) IPMask() (mask net.IPMask) {
|
|||
return
|
||||
}
|
||||
|
||||
// Check whether an IP matches a Ban
|
||||
// Match checks whether an IP matches a Ban
|
||||
func (ban Ban) Match(ip net.IP) bool {
|
||||
banned := ban.IP.Mask(ban.IPMask())
|
||||
masked := ip.Mask(ban.IPMask())
|
||||
|
|
@ -58,14 +58,14 @@ func (ban *Ban) SetISOStartDate(isodate string) {
|
|||
}
|
||||
}
|
||||
|
||||
// Return the currently set start date as an ISO 8601-formatted
|
||||
// ISOStartDate returns the currently set start date as an ISO 8601-formatted
|
||||
// date (in UTC).
|
||||
func (ban Ban) ISOStartDate() string {
|
||||
startTime := time.Unix(ban.Start, 0).UTC()
|
||||
return startTime.Format(ISODate)
|
||||
}
|
||||
|
||||
// Check whether a ban has expired
|
||||
// IsExpired checks whether a ban has expired
|
||||
func (ban Ban) IsExpired() bool {
|
||||
// ∞-case
|
||||
if ban.Duration == 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue