mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Add some missing doc comments
As pointed out by the linter, some exported functions and types are missing doc comments. The linter warnings have been reduced from 194 to 116. Not all missing comments have been added in this commit though.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
9891c0fb0e
commit
81c13171a9
@@ -29,14 +29,17 @@ func New() *Namespace {
|
||||
// Namespace provides template functions for the "math" namespace.
|
||||
type Namespace struct{}
|
||||
|
||||
// Add adds two numbers.
|
||||
func (ns *Namespace) Add(a, b interface{}) (interface{}, error) {
|
||||
return DoArithmetic(a, b, '+')
|
||||
}
|
||||
|
||||
// Div divides two numbers.
|
||||
func (ns *Namespace) Div(a, b interface{}) (interface{}, error) {
|
||||
return DoArithmetic(a, b, '/')
|
||||
}
|
||||
|
||||
// Log returns the natural logarithm of a number.
|
||||
func (ns *Namespace) Log(a interface{}) (float64, error) {
|
||||
af, err := cast.ToFloat64E(a)
|
||||
|
||||
@@ -84,10 +87,12 @@ func (ns *Namespace) ModBool(a, b interface{}) (bool, error) {
|
||||
return res == int64(0), nil
|
||||
}
|
||||
|
||||
// Mul multiplies two numbers.
|
||||
func (ns *Namespace) Mul(a, b interface{}) (interface{}, error) {
|
||||
return DoArithmetic(a, b, '*')
|
||||
}
|
||||
|
||||
// Sub substracts two numbers.
|
||||
func (ns *Namespace) Sub(a, b interface{}) (interface{}, error) {
|
||||
return DoArithmetic(a, b, '-')
|
||||
}
|
||||
|
Reference in New Issue
Block a user