aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl
diff options
context:
space:
mode:
authorPhil Davis <[email protected]>2020-12-16 16:56:32 +0545
committerGitHub <[email protected]>2020-12-16 12:11:32 +0100
commit04b89857e104ac7dcbf9fc65d8d4f1a1178123e6 (patch)
tree585bf761f0a1cfc69dffcd8afd22e94ca9da7c07 /tpl
parent21fa1e86f2aa929fb0983a0cc3dc4e271ea1cc54 (diff)
downloadhugo-04b89857e104ac7dcbf9fc65d8d4f1a1178123e6.tar.gz
hugo-04b89857e104ac7dcbf9fc65d8d4f1a1178123e6.zip
all: Fix minor typos
Diffstat (limited to 'tpl')
-rw-r--r--tpl/collections/collections_test.go4
-rw-r--r--tpl/collections/merge.go2
-rw-r--r--tpl/collections/sort_test.go2
-rw-r--r--tpl/compare/compare.go2
-rw-r--r--tpl/internal/go_templates/texttemplate/hugo_template.go2
-rw-r--r--tpl/math/math.go2
-rw-r--r--tpl/strings/strings.go2
-rw-r--r--tpl/template.go2
-rw-r--r--tpl/tplimpl/embedded/generate/generate.go4
-rw-r--r--tpl/urls/urls.go2
10 files changed, 12 insertions, 12 deletions
diff --git a/tpl/collections/collections_test.go b/tpl/collections/collections_test.go
index a75ec9d16..a9bf9a09b 100644
--- a/tpl/collections/collections_test.go
+++ b/tpl/collections/collections_test.go
@@ -673,7 +673,7 @@ func TestShuffleRandomising(t *testing.T) {
// Note that this test can fail with false negative result if the shuffle
// of the sequence happens to be the same as the original sequence. However
- // the propability of the event is 10^-158 which is negligible.
+ // the probability of the event is 10^-158 which is negligible.
seqLen := 100
rand.Seed(time.Now().UTC().UnixNano())
@@ -835,7 +835,7 @@ func TestUniq(t *testing.T) {
// Structs
{pagesVals{p3v, p2v, p3v, p2v}, pagesVals{p3v, p2v}, false},
- // not Comparable(), use hashstruscture
+ // not Comparable(), use hashstructure
{[]map[string]int{
{"K1": 1}, {"K2": 2}, {"K1": 1}, {"K2": 1},
}, []map[string]int{
diff --git a/tpl/collections/merge.go b/tpl/collections/merge.go
index de59de0af..43815560f 100644
--- a/tpl/collections/merge.go
+++ b/tpl/collections/merge.go
@@ -23,7 +23,7 @@ import (
"github.com/pkg/errors"
)
-// Merge creates a copy of the final parameter and merges the preceeding
+// Merge creates a copy of the final parameter and merges the preceding
// parameters into it in reverse order.
// Currently only maps are supported. Key handling is case insensitive.
func (ns *Namespace) Merge(params ...interface{}) (interface{}, error) {
diff --git a/tpl/collections/sort_test.go b/tpl/collections/sort_test.go
index 4798b5090..aa05b1874 100644
--- a/tpl/collections/sort_test.go
+++ b/tpl/collections/sort_test.go
@@ -53,7 +53,7 @@ func TestSort(t *testing.T) {
{[]int{1, 2, 3, 4, 5}, nil, "asc", []int{1, 2, 3, 4, 5}},
{[]int{5, 4, 3, 1, 2}, nil, "asc", []int{1, 2, 3, 4, 5}},
- // test sort key parameter is focibly set empty
+ // test sort key parameter is forcibly set empty
{[]string{"class3", "class1", "class2"}, map[int]string{1: "a"}, "asc", []string{"class1", "class2", "class3"}},
// test map sorting by keys
{map[string]int{"1": 10, "2": 20, "3": 30, "4": 40, "5": 50}, nil, "asc", []int{10, 20, 30, 40, 50}},
diff --git a/tpl/compare/compare.go b/tpl/compare/compare.go
index 8ce572273..88b18f00c 100644
--- a/tpl/compare/compare.go
+++ b/tpl/compare/compare.go
@@ -43,7 +43,7 @@ type Namespace struct {
func (*Namespace) Default(dflt interface{}, given ...interface{}) (interface{}, error) {
// given is variadic because the following construct will not pass a piped
// argument when the key is missing: {{ index . "key" | default "foo" }}
- // The Go template will complain that we got 1 argument when we expectd 2.
+ // The Go template will complain that we got 1 argument when we expected 2.
if len(given) == 0 {
return dflt, nil
diff --git a/tpl/internal/go_templates/texttemplate/hugo_template.go b/tpl/internal/go_templates/texttemplate/hugo_template.go
index 7cd6df0fb..eed546e61 100644
--- a/tpl/internal/go_templates/texttemplate/hugo_template.go
+++ b/tpl/internal/go_templates/texttemplate/hugo_template.go
@@ -94,7 +94,7 @@ func (t *Template) executeWithState(state *state, value reflect.Value) (err erro
return
}
-// Below are modifed structs etc. The changes are marked with "Added for Hugo."
+// Below are modified structs etc. The changes are marked with "Added for Hugo."
// state represents the state of an execution. It's not part of the
// template so that multiple executions of the same template
diff --git a/tpl/math/math.go b/tpl/math/math.go
index 2b2497c3e..badc189c8 100644
--- a/tpl/math/math.go
+++ b/tpl/math/math.go
@@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Package math provides template functions for mathmatical operations.
+// Package math provides template functions for mathematical operations.
package math
import (
diff --git a/tpl/strings/strings.go b/tpl/strings/strings.go
index 60cb658ba..178d17bc0 100644
--- a/tpl/strings/strings.go
+++ b/tpl/strings/strings.go
@@ -43,7 +43,7 @@ type Namespace struct {
deps *deps.Deps
}
-// CountRunes returns the number of runes in s, excluding whitepace.
+// CountRunes returns the number of runes in s, excluding whitespace.
func (ns *Namespace) CountRunes(s interface{}) (int, error) {
ss, err := cast.ToStringE(s)
if err != nil {
diff --git a/tpl/template.go b/tpl/template.go
index 73db9b3a6..0375b4a17 100644
--- a/tpl/template.go
+++ b/tpl/template.go
@@ -87,7 +87,7 @@ type TemplateParseFinder interface {
TemplateFinder
}
-// TemplateDebugger prints some debug info to stdoud.
+// TemplateDebugger prints some debug info to stdout.
type TemplateDebugger interface {
Debug()
}
diff --git a/tpl/tplimpl/embedded/generate/generate.go b/tpl/tplimpl/embedded/generate/generate.go
index 3f7cc0257..09a253e29 100644
--- a/tpl/tplimpl/embedded/generate/generate.go
+++ b/tpl/tplimpl/embedded/generate/generate.go
@@ -27,7 +27,7 @@ import (
func main() {
templateFolder := filepath.Join("..", "templates")
- temlatePath := filepath.Join(".", templateFolder)
+ templatePath := filepath.Join(".", templateFolder)
file, err := os.Create("../templates.autogen.go")
if err != nil {
@@ -37,7 +37,7 @@ func main() {
var nameValues []string
- err = filepath.Walk(temlatePath, func(path string, info os.FileInfo, err error) error {
+ err = filepath.Walk(templatePath, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
diff --git a/tpl/urls/urls.go b/tpl/urls/urls.go
index 652256f44..1bba636ad 100644
--- a/tpl/urls/urls.go
+++ b/tpl/urls/urls.go
@@ -141,7 +141,7 @@ func (ns *Namespace) refArgsToMap(args interface{}) (map[string]interface{}, err
return m, nil
case []string:
if len(v) == 0 || len(v) > 2 {
- return nil, fmt.Errorf("invalid numer of arguments to ref")
+ return nil, fmt.Errorf("invalid number of arguments to ref")
}
// These where the options before we introduced the map type:
s = v[0]