diff options
author | Bjørn Erik Pedersen <[email protected]> | 2017-05-20 11:28:33 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2017-05-20 11:34:38 +0300 |
commit | 1f9e8dcc6010abeea8abc7ba1a092c4dab9852f6 (patch) | |
tree | 96f71adc6ae9a109817a30055476d1409d55b60b /tpl/crypto | |
parent | ebd636e4d5f475d4b5d9047580e61ff7c2bf2fb5 (diff) | |
download | hugo-1f9e8dcc6010abeea8abc7ba1a092c4dab9852f6.tar.gz hugo-1f9e8dcc6010abeea8abc7ba1a092c4dab9852f6.zip |
tpl: Make the Namespace func signature explicit
This makes it cleaner and avoids breaking client code, such as the docs helper JSON generator.
Diffstat (limited to 'tpl/crypto')
-rw-r--r-- | tpl/crypto/init.go | 2 | ||||
-rw-r--r-- | tpl/crypto/init_test.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tpl/crypto/init.go b/tpl/crypto/init.go index a47c3369f..08421e1b2 100644 --- a/tpl/crypto/init.go +++ b/tpl/crypto/init.go @@ -26,7 +26,7 @@ func init() { ns := &internal.TemplateFuncsNamespace{ Name: name, - Context: func() interface{} { return ctx }, + Context: func(args ...interface{}) interface{} { return ctx }, } ns.AddMethodMapping(ctx.MD5, diff --git a/tpl/crypto/init_test.go b/tpl/crypto/init_test.go index 20c0201e5..755f162d0 100644 --- a/tpl/crypto/init_test.go +++ b/tpl/crypto/init_test.go @@ -34,5 +34,5 @@ func TestInit(t *testing.T) { } require.True(t, found) - require.IsType(t, &Namespace{}, ns.Context.(func() interface{})()) + require.IsType(t, &Namespace{}, ns.Context()) } |