mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
@@ -114,7 +114,6 @@ func init() {
|
||||
)
|
||||
|
||||
return ns
|
||||
|
||||
}
|
||||
|
||||
internal.AddTemplateFuncsNamespace(f)
|
||||
|
@@ -64,7 +64,6 @@ func (ns *Namespace) Floor(x interface{}) (float64, error) {
|
||||
// Log returns the natural logarithm of a number.
|
||||
func (ns *Namespace) Log(a interface{}) (float64, error) {
|
||||
af, err := cast.ToFloat64E(a)
|
||||
|
||||
if err != nil {
|
||||
return 0, errors.New("Log operator can't be used with non integer or float value")
|
||||
}
|
||||
@@ -76,7 +75,6 @@ func (ns *Namespace) Log(a interface{}) (float64, error) {
|
||||
// NOTE: will return for NaN for negative values of a
|
||||
func (ns *Namespace) Sqrt(a interface{}) (float64, error) {
|
||||
af, err := cast.ToFloat64E(a)
|
||||
|
||||
if err != nil {
|
||||
return 0, errors.New("Sqrt operator can't be used with non integer or float value")
|
||||
}
|
||||
|
@@ -197,7 +197,6 @@ func TestSqrt(t *testing.T) {
|
||||
result, err := ns.Sqrt(-1)
|
||||
c.Assert(err, qt.IsNil)
|
||||
c.Assert(result, qt.Satisfies, math.IsNaN)
|
||||
|
||||
}
|
||||
|
||||
func TestMod(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user