all: Fix minor typos

This commit is contained in:
Phil Davis
2020-12-16 16:56:32 +05:45
committed by GitHub
parent 21fa1e86f2
commit 04b89857e1
67 changed files with 124 additions and 124 deletions

View File

@@ -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{

View File

@@ -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) {

View File

@@ -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}},

View File

@@ -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

View File

@@ -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

View File

@@ -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 (

View File

@@ -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 {

View File

@@ -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()
}

View File

@@ -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
}

View File

@@ -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]