aboutsummaryrefslogtreecommitdiffhomepage
path: root/deps
diff options
context:
space:
mode:
authorJorin Vogel <[email protected]>2017-08-02 14:25:05 +0200
committerBjørn Erik Pedersen <[email protected]>2017-08-03 15:57:51 +0200
commit81c13171a985b89f2af6682dbd1d4b8766cb9af7 (patch)
treedb39d78bbe6da0ea3f3dd3d2f94c7e1571ad8fd6 /deps
parent9891c0fb0eb274b8a95b62c40070a87a6e04088c (diff)
downloadhugo-81c13171a985b89f2af6682dbd1d4b8766cb9af7.tar.gz
hugo-81c13171a985b89f2af6682dbd1d4b8766cb9af7.zip
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.
Diffstat (limited to 'deps')
-rw-r--r--deps/deps.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/deps/deps.go b/deps/deps.go
index b5f935c09..ed073c5d3 100644
--- a/deps/deps.go
+++ b/deps/deps.go
@@ -14,7 +14,7 @@ import (
)
// Deps holds dependencies used by many.
-// There will be normally be only one instance of deps in play
+// There will be normally only one instance of deps in play
// at a given time, i.e. one per Site built.
type Deps struct {
// The logger to use.
@@ -55,10 +55,12 @@ type ResourceProvider interface {
Clone(deps *Deps) error
}
+// TemplateHandler returns the used tpl.TemplateFinder as tpl.TemplateHandler.
func (d *Deps) TemplateHandler() tpl.TemplateHandler {
return d.Tmpl.(tpl.TemplateHandler)
}
+// LoadResources loads translations and templates.
func (d *Deps) LoadResources() error {
// Note that the translations need to be loaded before the templates.
if err := d.translationProvider.Update(d); err != nil {
@@ -76,6 +78,9 @@ func (d *Deps) LoadResources() error {
return nil
}
+// New initializes a Dep struct.
+// Defaults are set for nil values,
+// but TemplateProvider, TranslationProvider and Language are always required.
func New(cfg DepsCfg) (*Deps, error) {
var (
logger = cfg.Logger