]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
tpl/lang: Formally deprecate lang.NumFmt
authorJoe Mooring <joe.mooring@veriphor.com>
Tue, 26 Sep 2023 21:04:01 +0000 (14:04 -0700)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 27 Sep 2023 15:34:45 +0000 (17:34 +0200)
Use lang.FormatNumberCustom instead.

tpl/lang/lang.go

index 814191c3ad31c91e2ded116f5b28d1123244396c..e83f70710b25e203b1547723be42a8cbb957a22a 100644 (file)
@@ -28,6 +28,7 @@ import (
 
        "github.com/gohugoio/hugo/common/hreflect"
        "github.com/gohugoio/hugo/deps"
+       "github.com/gohugoio/hugo/helpers"
        "github.com/spf13/cast"
 )
 
@@ -240,10 +241,9 @@ func (ns *Namespace) FormatNumberCustom(precision, number any, options ...any) (
        return string(b), nil
 }
 
-// NumFmt is deprecated, use FormatNumberCustom.
-// We renamed this in Hugo 0.87.
-// Deprecated: Use FormatNumberCustom
+// Deprecated: Use lang.FormatNumberCustom instead.
 func (ns *Namespace) NumFmt(precision, number any, options ...any) (string, error) {
+       helpers.Deprecated("lang.NumFmt", "Use lang.FormatNumberCustom instead.", false)
        return ns.FormatNumberCustom(precision, number, options...)
 }