all: Fix minor typos
authorPhil Davis <phil@jankaritech.com>
Wed, 16 Dec 2020 11:11:32 +0000 (16:56 +0545)
committerGitHub <noreply@github.com>
Wed, 16 Dec 2020 11:11:32 +0000 (12:11 +0100)
67 files changed:
benchSite.sh
cache/filecache/filecache.go
cache/namedmemcache/named_cache.go
codegen/methods.go
common/hugio/readers.go
config/commonConfig.go
helpers/path.go
helpers/pathspec.go
helpers/url.go
hugofs/filter_fs.go
hugofs/nosymlink_test.go
hugofs/rootmapping_fs_test.go
hugolib/breaking_changes_test.go
hugolib/content_map.go
hugolib/content_map_page.go
hugolib/embedded_shortcodes_test.go
hugolib/hugo_modules_test.go
hugolib/page.go
hugolib/page__common.go
hugolib/pagebundler_test.go
hugolib/pagecollections.go
hugolib/pages_capture.go
hugolib/paths/paths.go
hugolib/site.go
hugolib/taxonomy_test.go
hugolib/testhelpers_test.go
langs/language.go
markup/highlight/config.go
media/mediaType.go
minifiers/minifiers_test.go
modules/collect.go
parser/metadecoders/decoder.go
parser/pageparser/pagelexer.go
parser/pageparser/pagelexer_intro.go
parser/pageparser/pagelexer_shortcode.go
parser/pageparser/pageparser.go
publisher/htmlElementsCollector.go
releaser/releaser.go
resources/image.go
resources/image_cache.go
resources/image_test.go
resources/page/page_generate/generate_page_wrappers.go
resources/page/page_outputformat.go
resources/page/pagegroup.go
resources/page/pages.go
resources/page/pages_prev_next.go
resources/page/pages_related.go
resources/resource.go
resources/resource_spec.go
resources/resource_test.go
resources/resource_transformers/babel/babel.go
resources/resource_transformers/minifier/minify.go
resources/resource_transformers/postcss/postcss.go
resources/transform.go
source/fileInfo.go
tpl/collections/collections_test.go
tpl/collections/merge.go
tpl/collections/sort_test.go
tpl/compare/compare.go
tpl/internal/go_templates/texttemplate/hugo_template.go
tpl/math/math.go
tpl/strings/strings.go
tpl/template.go
tpl/tplimpl/embedded/generate/generate.go
tpl/urls/urls.go
transform/chain_test.go
transform/urlreplacers/absurlreplacer_test.go

index 623086708303b8c7c9bffee576869e79ad874197..aae21231c7f5f7401c0f2533651a026c39676c7c 100755 (executable)
@@ -3,7 +3,7 @@
 # allow user to override go executable by running as GOEXE=xxx make ...
 GOEXE="${GOEXE-go}"
 
-# Send in a regexp mathing the benchmarks you want to run, i.e. './benchSite.sh "YAML"'. 
+# Send in a regexp matching the benchmarks you want to run, i.e. './benchSite.sh "YAML"'.
 # Note the quotes, which will be needed for more complex expressions.
 # The above will run all variations, but only for front matter YAML.
 
index c586f9a51ab1012ac5ecd04d6031fd283d2c7982..ffb0895b03f87e11c561f976abac68592e24c409 100644 (file)
@@ -221,7 +221,7 @@ func (c *Cache) GetOrCreateBytes(id string, create func() ([]byte, error)) (Item
        return info, b, nil
 }
 
-// GetBytes gets the file content with the given id from the cahce, nil if none found.
+// GetBytes gets the file content with the given id from the cache, nil if none found.
 func (c *Cache) GetBytes(id string) (ItemInfo, []byte, error) {
        id = cleanID(id)
 
index d67bcc28a56471dd4ba8636eb1b35d126bb74638..4e912bf587132cd32874d5cbb9b41ed5482bc34e 100644 (file)
@@ -54,7 +54,7 @@ func (c *Cache) Clear() {
 // GetOrCreate tries to get the value with the given cache key, if not found
 // create will be called and cached.
 // This method is thread safe. It also guarantees that the create func for a given
-// key is invoced only once for this cache.
+// key is invoked only once for this cache.
 func (c *Cache) GetOrCreate(key string, create func() (interface{}, error)) (interface{}, error) {
        c.mu.RLock()
        entry, found := c.cache[key]
index 38477e333c49d6265fb0fab3b4ee1ca3b217c700..23994c5f87545e45902f5c89c9a28b038f246bbd 100644 (file)
@@ -365,7 +365,7 @@ func (m Methods) Imports() []string {
 }
 
 // ToMarshalJSON creates a MarshalJSON method for these methods. Any method name
-// matchin any of the regexps in excludes will be ignored.
+// matching any of the regexps in excludes will be ignored.
 func (m Methods) ToMarshalJSON(receiver, pkgPath string, excludes ...string) (string, []string) {
        var sb strings.Builder
 
index 8c901dd24091bb8d09ad10f0959c547a457578f7..c93e05e8650e71ad4049894bba10c7a8fae8ce8a 100644 (file)
@@ -32,7 +32,7 @@ type ReadSeekCloser interface {
 }
 
 // ReadSeekerNoOpCloser implements ReadSeekCloser by doing nothing in Close.
-// TODO(bep) rename this and simila to ReadSeekerNopCloser, naming used in stdlib, which kind of makes sense.
+// TODO(bep) rename this and similar to ReadSeekerNopCloser, naming used in stdlib, which kind of makes sense.
 type ReadSeekerNoOpCloser struct {
        ReadSeeker
 }
index 260ebe73e58a9cecdaa103045043322f3a67bb49..d0d24f8ff3a96e46885fd935af17e9347b78ce6c 100644 (file)
@@ -34,7 +34,7 @@ var DefaultBuild = Build{
        WriteStats:           false,
 }
 
-// Build holds some build related condfiguration.
+// Build holds some build related configuration.
 type Build struct {
        UseResourceCacheWhen string // never, fallback, always. Default is fallback
 
index abc73d081b5b735ab7d65418323bf101d7a8098f..17a513cecd9706a05aba43c442dbf7f54a99bcf9 100644 (file)
@@ -128,7 +128,7 @@ func ishex(c rune) bool {
 
 // UnicodeSanitize sanitizes string to be used in Hugo URL's, allowing only
 // a predefined set of special Unicode characters.
-// If RemovePathAccents configuration flag is enabled, Uniccode accents
+// If RemovePathAccents configuration flag is enabled, Unicode accents
 // are also removed.
 // Spaces will be replaced with a single hyphen, and sequential hyphens will be reduced to one.
 func (p *PathSpec) UnicodeSanitize(s string) string {
@@ -212,12 +212,12 @@ func GetDottedRelativePath(inPath string) string {
        return dottedPath
 }
 
-// ExtNoDelimiter takes a path and returns the extension, excluding the delmiter, i.e. "md".
+// ExtNoDelimiter takes a path and returns the extension, excluding the delimiter, i.e. "md".
 func ExtNoDelimiter(in string) string {
        return strings.TrimPrefix(Ext(in), ".")
 }
 
-// Ext takes a path and returns the extension, including the delmiter, i.e. ".md".
+// Ext takes a path and returns the extension, including the delimiter, i.e. ".md".
 func Ext(in string) string {
        _, ext := fileAndExt(in, fpb)
        return ext
@@ -229,13 +229,13 @@ func PathAndExt(in string) (string, string) {
 }
 
 // FileAndExt takes a path and returns the file and extension separated,
-// the extension including the delmiter, i.e. ".md".
+// the extension including the delimiter, i.e. ".md".
 func FileAndExt(in string) (string, string) {
        return fileAndExt(in, fpb)
 }
 
 // FileAndExtNoDelimiter takes a path and returns the file and extension separated,
-// the extension excluding the delmiter, e.g "md".
+// the extension excluding the delimiter, e.g "md".
 func FileAndExtNoDelimiter(in string) (string, string) {
        file, ext := fileAndExt(in, fpb)
        return file, strings.TrimPrefix(ext, ".")
index 5400249eb50312a16962902c439e3e88d17f0363..49fd9a71cfaefe48705384e34cdffe349a3d6093 100644 (file)
@@ -37,7 +37,7 @@ type PathSpec struct {
        Cfg config.Provider
 }
 
-// NewPathSpec creats a new PathSpec from the given filesystems and language.
+// NewPathSpec creates a new PathSpec from the given filesystems and language.
 func NewPathSpec(fs *hugofs.Fs, cfg config.Provider, logger loggers.Logger) (*PathSpec, error) {
        return NewPathSpecWithBaseBaseFsProvided(fs, cfg, logger, nil)
 }
index 6f4242b09842f3757d12817885ae4928a8f97e7e..8c39bc4fa10ef7f6043a993ea28417dcb72afbae 100644 (file)
@@ -105,7 +105,7 @@ func (p *PathSpec) URLize(uri string) string {
        return p.URLEscape(p.MakePathSanitized(uri))
 }
 
-// URLizeFilename creates an URL from a filename by esacaping unicode letters
+// URLizeFilename creates an URL from a filename by escaping unicode letters
 // and turn any filepath separator into forward slashes.
 func (p *PathSpec) URLizeFilename(filename string) string {
        return p.URLEscape(filepath.ToSlash(filename))
@@ -280,7 +280,7 @@ func AddContextRoot(baseURL, relativePath string) string {
 
        newPath := path.Join(url.Path, relativePath)
 
-       // path strips traling slash, ignore root path.
+       // path strips trailing slash, ignore root path.
        if newPath != "/" && strings.HasSuffix(relativePath, "/") {
                newPath += "/"
        }
index 8b0afd38d21345729a1319d49feb79a96c9f967f..279a28312764a73f9b4ebbf22f63c7d4df6f3af4 100644 (file)
@@ -276,7 +276,7 @@ func (f *filterDir) Readdirnames(count int) ([]string, error) {
 }
 
 // Try to extract the language from the given filename.
-// Any valid language identificator in the name will win over the
+// Any valid language identifier in the name will win over the
 // language set on the file system, e.g. "mypost.en.md".
 func langInfoFrom(languages map[string]int, name string) (string, string, string) {
        var lang string
index 99151ec67f7f273d023ceaab26ba70cdcc151307..e00dcf1a8e4994e2b63c4259716d7baadc96b722 100644 (file)
@@ -135,7 +135,7 @@ func TestNoSymlinkFs(t *testing.T) {
                        // Check readdir
                        f, err = fs.Open(workDir)
                        c.Assert(err, qt.IsNil)
-                       // There is at least one unsported symlink inside workDir
+                       // There is at least one unsupported symlink inside workDir
                        _, err = f.Readdir(-1)
                        c.Assert(err, qt.IsNil)
                        f.Close()
index e5f68d7a9fd83d3a9a7404cbec6b60dcee05dd16..fc2ddeb621e2e518008893999faa0c65193b417d 100644 (file)
@@ -270,7 +270,7 @@ func TestRootMappingFsMount(t *testing.T) {
        c.Assert(err, qt.IsNil)
        c.Assert(string(b), qt.Equals, "some no content")
 
-       // Ambigous
+       // Ambiguous
        _, err = rfs.Stat(filepath.FromSlash("content/singles/p1.md"))
        c.Assert(err, qt.Not(qt.IsNil))
 
index a22bc240fc3e7c9cf92f764be2af3a4d94545d14..495baff3ec42a74e909fc8f51df420e83bdb28ce 100644 (file)
@@ -21,7 +21,7 @@ import (
 )
 
 func Test073(t *testing.T) {
-       asertDisabledTaxonomyAndTerm := func(b *sitesBuilder, taxonomy, term bool) {
+       assertDisabledTaxonomyAndTerm := func(b *sitesBuilder, taxonomy, term bool) {
                b.Assert(b.CheckExists("public/tags/index.html"), qt.Equals, taxonomy)
                b.Assert(b.CheckExists("public/tags/tag1/index.html"), qt.Equals, term)
        }
@@ -88,7 +88,7 @@ taxonomy = ["JSON"]
                        `disableKinds = ["taxonomy", "taxonomyTerm"]`,
                        func(err error, out string, b *sitesBuilder) {
                                b.Assert(err, qt.IsNil)
-                               asertDisabledTaxonomyAndTerm(b, false, false)
+                               assertDisabledTaxonomyAndTerm(b, false, false)
                        },
                },
                {
@@ -96,7 +96,7 @@ taxonomy = ["JSON"]
                        `disableKinds = ["taxonomyTerm"]`,
                        func(err error, out string, b *sitesBuilder) {
                                b.Assert(err, qt.IsNil)
-                               asertDisabledTaxonomyAndTerm(b, false, true)
+                               assertDisabledTaxonomyAndTerm(b, false, true)
                        },
                },
                {
@@ -113,7 +113,7 @@ taxonomy = ["JSON"]
                        ignoreErrors = ["error-disable-taxonomy"]`,
                        func(err error, out string, b *sitesBuilder) {
                                b.Assert(err, qt.IsNil)
-                               asertDisabledTaxonomyAndTerm(b, false, true)
+                               assertDisabledTaxonomyAndTerm(b, false, true)
                        },
                },
        } {
index ca2aa3672ac1c11e75944f9559e4a0596e50aa26..3f5ed65c39225e3a281760328b04a9903719b9ff 100644 (file)
@@ -58,8 +58,8 @@ const (
        cmLeafSeparator   = "__hl_"
 )
 
-// Used to mark ambigous keys in reverse index lookups.
-var ambigousContentNode = &contentNode{}
+// Used to mark ambiguous keys in reverse index lookups.
+var ambiguousContentNode = &contentNode{}
 
 func newContentMap(cfg contentMapConfig) *contentMap {
        m := &contentMap{
@@ -86,8 +86,8 @@ func newContentMap(cfg contentMapConfig) *contentMap {
        addToReverseMap := func(k string, n *contentNode, m map[interface{}]*contentNode) {
                k = strings.ToLower(k)
                existing, found := m[k]
-               if found && existing != ambigousContentNode {
-                       m[k] = ambigousContentNode
+               if found && existing != ambiguousContentNode {
+                       m[k] = ambiguousContentNode
                } else if !found {
                        m[k] = n
                }
index 296363359fe1e2def4c452485401eb46b009099d..74dd0e02904a6533b74512491df54f9b672b609d 100644 (file)
@@ -232,7 +232,7 @@ func (m *pageMap) newResource(fim hugofs.FileMetaInfo, owner *pageState) (resour
        outputFormats := owner.m.outputFormats()
        seen := make(map[string]bool)
        var targetBasePaths []string
-       // Make sure bundled resources are published to all of the ouptput formats'
+       // Make sure bundled resources are published to all of the output formats'
        // sub paths.
        for _, f := range outputFormats {
                p := f.Path
index 3ea1d8ab08c048b4ec56cfd8ebba431fd62ed610..90f2685af03179b1f8329c453aae77ae7153ee38 100644 (file)
@@ -185,7 +185,7 @@ func TestShortcodeYoutube(t *testing.T) {
                        `{{< youtube id="w7Ft2ymGmfc" class="video" autoplay="true" >}}`,
                        "(?s)\n<div class=\"video\">.*?<iframe src=\"https://www.youtube.com/embed/w7Ft2ymGmfc\\?autoplay=1\".*?allowfullscreen title=\"YouTube Video\">.*?</iframe>.*?</div>",
                },
-               // set custom title for accessability)
+               // set custom title for accessibility)
                {
                        `{{< youtube id="w7Ft2ymGmfc" title="A New Hugo Site in Under Two Minutes" >}}`,
                        "(?s)\n<div style=\".*?\">.*?<iframe src=\"https://www.youtube.com/embed/w7Ft2ymGmfc\" style=\".*?\" allowfullscreen title=\"A New Hugo Site in Under Two Minutes\">.*?</iframe>.*?</div>",
index f63da5a079d14ea1243febe205440a9295b424cf..4946d0f5917f5c82118767c606f1c47e850fdac0 100644 (file)
@@ -151,7 +151,7 @@ JS imported in module: |
         "devDependencies": {
                 "postcss-cli": "7.8.0",
                 "tailwindcss": "1.8.0"
+
         }
 }`)
 
@@ -375,7 +375,7 @@ module github.com/gohugoio/tests/testHugoModules
 }
 
 func createChildModMatchers(m *mods.Md, ignoreVendor, vendored bool) []string {
-       // Child depdendencies are one behind.
+       // Child dependencies are one behind.
        expectMinorVersion := 3
 
        if !ignoreVendor && vendored {
@@ -1078,7 +1078,7 @@ workingDir=%q
   [[module.mounts]]
     source = %q
     target = "content"
-    
+
 `, workDir, absContentDir)
 
        defer clean1()
index 47aeb6e9ab11ad884772fb9c5e1125a47f7320cd..6c177b6878fb462d8340ba6c9f82a5a5a1ba81c5 100644 (file)
@@ -584,7 +584,7 @@ type renderStringOpts struct {
        Markup  string
 }
 
-var defualtRenderStringOpts = renderStringOpts{
+var defaultRenderStringOpts = renderStringOpts{
        Display: "inline",
        Markup:  "", // Will inherit the page's value when not set.
 }
@@ -595,7 +595,7 @@ func (p *pageState) RenderString(args ...interface{}) (template.HTML, error) {
        }
 
        var s string
-       opts := defualtRenderStringOpts
+       opts := defaultRenderStringOpts
        sidx := 1
 
        if len(args) == 1 {
@@ -978,7 +978,7 @@ func (p *pageState) shiftToOutputFormat(isRenderingSite bool, idx int) error {
 //
 // For pages that have a source file, it is returns the path to this file as an
 // absolute path rooted in this site's content dir.
-// For pages that do not (sections witout content page etc.), it returns the
+// For pages that do not (sections without content page etc.), it returns the
 // virtual path, consistent with where you would add a source file.
 func (p *pageState) sourceRef() string {
        if !p.File().IsZero() {
index d1c7ba8663a3eb988cfd9176d519d2a408a07f4f..e718721f7fcd52da38d44e661ca045e9ebd7ae13 100644 (file)
@@ -57,7 +57,7 @@ type pageCommon struct {
        bucket  *pagesMapBucket
        treeRef *contentTreeRef
 
-       // Laziliy initialized dependencies.
+       // Lazily initialized dependencies.
        init *lazy.Init
 
        // All of these represents the common parts of a page.Page
index 8f94595642a12f0a25aeffd1960d9128420dcc98..5589a3e3272ba1a50d05f8c4f3504e853c803eb8 100644 (file)
@@ -302,7 +302,7 @@ func TestPageBundlerSiteMultilingual(t *testing.T) {
                                // A bundle in a/b/index.en.md
                                // a/b/index.en.md => OK
                                // a/b/index => OK
-                               // index.en.md => ambigous, but OK.
+                               // index.en.md => ambiguous, but OK.
                                // With bundles, the file name has little meaning, the folder it lives in does. So this should also work:
                                // a/b
                                // and probably also just b (aka "my-bundle")
@@ -1250,7 +1250,7 @@ func TestBundleTransformMany(t *testing.T) {
 title: "Page"
 weight: %d
 ---
-               
+
 `, i))
                b.WithSourceFile(fmt.Sprintf("content/bundle%d/data.yaml", i), fmt.Sprintf(`data: v%d`, i))
                b.WithSourceFile(fmt.Sprintf("content/bundle%d/data.json", i), fmt.Sprintf(`{ "data": "v%d" }`, i))
index c1c9ef88b1561518a3371642d3662a1cf664b1f8..2e4287612122dc820ff8b8ec59d20b53189d36dd 100644 (file)
@@ -98,7 +98,7 @@ func newPageCollections(m *pageMap) *PageCollections {
 
 // This is an adapter func for the old API with Kind as first argument.
 // This is invoked when you do .Site.GetPage. We drop the Kind and fails
-// if there are more than 2 arguments, which would be ambigous.
+// if there are more than 2 arguments, which would be ambiguous.
 func (c *PageCollections) getPageOldVersion(ref ...string) (page.Page, error) {
        var refs []string
        for _, r := range ref {
@@ -291,7 +291,7 @@ func (c *PageCollections) getContentNode(context page.Page, isReflink bool, ref
        getByName := func(s string) (*contentNode, error) {
                n := m.pageReverseIndex.Get(s)
                if n != nil {
-                       if n == ambigousContentNode {
+                       if n == ambiguousContentNode {
                                return nil, fmt.Errorf("page reference %q is ambiguous", ref)
                        }
                        return n, nil
index 98e9fda51139cb965e53fae262fd7a3f28cc1d0b..c7a42acdc0b7b777db65daca2a9ea5194f097493 100644 (file)
@@ -278,7 +278,7 @@ func (c *pagesCollector) addToBundle(info hugofs.FileMetaInfo, btyp bundleDirTyp
                        if btyp == bundleBranch {
                                // No special logic for branch bundles.
                                // Every language needs its own _index.md file.
-                               // Also, we only clone bundle headers for lonsesome, bundled,
+                               // Also, we only clone bundle headers for lonesome, bundled,
                                // content files.
                                return c.handleFiles(info)
                        }
index 8af77b07230bab192f76914223aea6065ea67800..bcf01a969e05a4b347d9cee245e65291c4707b57 100644 (file)
@@ -268,7 +268,7 @@ func (p *Paths) RelPathify(filename string) string {
        return strings.TrimPrefix(strings.TrimPrefix(filename, p.WorkingDir), FilePathSeparator)
 }
 
-// AbsPathify creates an absolute path if given a working dir and arelative path.
+// AbsPathify creates an absolute path if given a working dir and a relative path.
 // If already absolute, the path is just cleaned.
 func AbsPathify(workingDir, inPath string) string {
        if filepath.IsAbs(inPath) {
index 4175fecc24786b8b098b39c505e4b83e772b69a2..d2a5e68aeebe0e52b7538bfd345ad540838d6458 100644 (file)
@@ -956,7 +956,7 @@ func (s *Site) translateFileEvents(events []fsnotify.Event) []fsnotify.Event {
        eventMap := make(map[string][]fsnotify.Event)
 
        // We often get a Remove etc. followed by a Create, a Create followed by a Write.
-       // Remove the superflous events to mage the update logic simpler.
+       // Remove the superfluous events to mage the update logic simpler.
        for _, ev := range events {
                eventMap[ev.Name] = append(eventMap[ev.Name], ev)
        }
@@ -999,7 +999,7 @@ var (
 )
 
 // reBuild partially rebuilds a site given the filesystem events.
-// It returns whetever the content source was changed.
+// It returns whatever the content source was changed.
 // TODO(bep) clean up/rewrite this method.
 func (s *Site) processPartial(config *BuildCfg, init func(config *BuildCfg) error, events []fsnotify.Event) error {
        events = s.filterFileEvents(events)
@@ -1513,7 +1513,7 @@ func (s *Site) assembleMenus() {
        }
 }
 
-// get any lanaguagecode to prefix the target file path with.
+// get any language code to prefix the target file path with.
 func (s *Site) getLanguageTargetPathLang(alwaysInSubDir bool) string {
        if s.h.IsMultihost() {
                return s.Language().Lang
index dba4f48567b826b43a8c302d8e17110d92010c10..b2603217402f05fa671e76bb8314600d8add0003 100644 (file)
@@ -316,7 +316,7 @@ categories: ["This is Cool", "And new" ]
 ---
 
 Content.
-               
+
                `)
        }
 
@@ -454,7 +454,7 @@ categories: ["funny"]
        `,
                "categories/_index.md", "---\ntitle: Categories Page\n---",
                "categories/data.json", "Category data",
-               "categories/funny/_index.md", "---\ntitle: Funnny Category\n---",
+               "categories/funny/_index.md", "---\ntitle: Funny Category\n---",
                "categories/funny/funnydata.json", "Category funny data",
        )
 
@@ -525,7 +525,7 @@ Funny:|/p2/|`)
 func TestTaxonomiesListPages(t *testing.T) {
        b := newTestSitesBuilder(t)
        b.WithTemplates("_default/list.html", `
-       
+
 {{ template "print-taxo" "categories.cats" }}
 {{ template "print-taxo" "categories.funny" }}
 
@@ -560,7 +560,7 @@ categories: ["cats"]
        b.Build(BuildCfg{})
 
        b.AssertFileContent("public/index.html", `
-    
+
 Len categories.cats: 2
 categories.cats:|/blog/|
 categories.cats:|/|
index 726930721909a0633cc8f3d2dbc89cee9240bc26..78d80bebf755fd30af9f181bce9870b0e3487d7d 100644 (file)
@@ -928,13 +928,13 @@ func buildSingleSite(t testing.TB, depsCfg deps.DepsCfg, buildCfg BuildCfg) *Sit
        return buildSingleSiteExpected(t, false, false, depsCfg, buildCfg)
 }
 
-func buildSingleSiteExpected(t testing.TB, expectSiteInitEror, expectBuildError bool, depsCfg deps.DepsCfg, buildCfg BuildCfg) *Site {
+func buildSingleSiteExpected(t testing.TB, expectSiteInitError, expectBuildError bool, depsCfg deps.DepsCfg, buildCfg BuildCfg) *Site {
        t.Helper()
        b := newTestSitesBuilderFromDepsCfg(t, depsCfg).WithNothingAdded()
 
        err := b.CreateSitesE()
 
-       if expectSiteInitEror {
+       if expectSiteInitError {
                b.Assert(err, qt.Not(qt.IsNil))
                return nil
        } else {
index 9fa22b05a8f4f54873c3eff4b46306419af099a9..bdfde573cbbcd4cfff8dfcf90963642f3ff5e2f8 100644 (file)
@@ -126,7 +126,7 @@ func (l Languages) Less(i, j int) bool {
 
 func (l Languages) Swap(i, j int) { l[i], l[j] = l[j], l[i] }
 
-// Params retunrs language-specific params merged with the global params.
+// Params returns language-specific params merged with the global params.
 func (l *Language) Params() maps.Params {
        // TODO(bep) this construct should not be needed. Create the
        // language params in one go.
index 1bee58dc5a16f5a6863488552e5232306f5058bb..1dc1e28e2473b46ef73fe4e142ecfea0b00f83e7 100644 (file)
@@ -155,7 +155,7 @@ func parseOptions(in string) (map[string]interface{}, error) {
        return opts, nil
 }
 
-// startLine compansates for https://github.com/alecthomas/chroma/issues/30
+// startLine compensates for https://github.com/alecthomas/chroma/issues/30
 func hlLinesToRanges(startLine int, s string) ([][2]int, error) {
        var ranges [][2]int
        s = strings.TrimSpace(s)
index 21d4ddca572c99c3b7de7edbb8205b1ec24194d2..9e35212b2caa65dfdad63c6f92536ef07588a939 100644 (file)
@@ -40,7 +40,7 @@ type Type struct {
        SubType  string `json:"subType"`  // i.e. html
 
        // This is the optional suffix after the "+" in the MIME type,
-       //  e.g. "xml" in "applicatiion/rss+xml".
+       //  e.g. "xml" in "application/rss+xml".
        mimeSuffix string
 
        Delimiter string `json:"delimiter"` // e.g. "."
@@ -107,7 +107,7 @@ func (m Type) FullSuffix() string {
        return m.Delimiter + m.Suffix()
 }
 
-// Suffix returns the file suffix without any delmiter prepended.
+// Suffix returns the file suffix without any delimiter prepended.
 func (m Type) Suffix() string {
        if m.fileSuffix != "" {
                return m.fileSuffix
index c3922b06d4eb4adee9b7d79fb1af03e474b870c9..9e62c5d507e019ab01c57fcf379465fadf38b144 100644 (file)
@@ -95,7 +95,7 @@ func TestConfigureMinify(t *testing.T) {
        }{
                {media.HTMLType, "<hello> Hugo! </hello>", "<hello> Hugo! </hello>", false}, // configured minifier
                {media.CSSType, " body { color: blue; }  ", "body{color:blue}", false},      // default minifier
-               {media.XMLType, " <hello>  Hugo!   </hello>  ", "", true},                   // disable Xml minificatin
+               {media.XMLType, " <hello>  Hugo!   </hello>  ", "", true},                   // disable Xml minification
        } {
                var b bytes.Buffer
                if !test.errorExpected {
index 179b9d1fbc6bfa9b069d0c7e5beaad424180fd7f..eb7e0d0000ae6423129bf87b7878d76a700e6491 100644 (file)
@@ -559,7 +559,7 @@ func (c *collector) mountCommonJSConfig(owner *moduleAdapter, mounts []Mount) ([
        for _, m := range mounts {
                if strings.HasPrefix(m.Target, files.JsConfigFolderMountPrefix) {
                        // This follows the convention of the other component types (assets, content, etc.),
-                       // if one or more is specificed by the user, we skip the defaults.
+                       // if one or more is specified by the user, we skip the defaults.
                        // These mounts were added to Hugo in 0.75.
                        return mounts, nil
                }
index 7fc8330af2e4be6843f6fbb1a8473090e3b5ee34..131d6f39b069387ef2274048cb251f6b23c8198d 100644 (file)
@@ -105,7 +105,7 @@ func (d Decoder) UnmarshalStringTo(data string, typ interface{}) (interface{}, e
        case float64:
                return cast.ToFloat64E(data)
        default:
-               return nil, errors.Errorf("unmarshal: %T not supportedd", typ)
+               return nil, errors.Errorf("unmarshal: %T not supported", typ)
        }
 }
 
index c360642c4424f79e96bdefd8f0aefe0d1f9409d3..266fb50f5a6325edcbdcae881777cfd72acfe078 100644 (file)
@@ -426,7 +426,7 @@ func lexMainSection(l *pageLexer) stateFunc {
        }
 
        if l.isInHTMLComment {
-               return lexEndFromtMatterHTMLComment
+               return lexEndFrontMatterHTMLComment
        }
 
        // Fast forward as far as possible.
index 961528ef25e6deadea4be60625034c9bfe1082df..6e46179981f8772e9bcfdf6f6dcc8a07f29933dc 100644 (file)
@@ -56,7 +56,7 @@ LOOP:
        return lexMainSection
 }
 
-func lexEndFromtMatterHTMLComment(l *pageLexer) stateFunc {
+func lexEndFrontMatterHTMLComment(l *pageLexer) stateFunc {
        l.isInHTMLComment = false
        right := l.index(htmlCommentEnd)
        if right == -1 {
index 774a8f690221e96d30abbb8ed5ec49ca10653898..5b4e0ae55630e89c390e4098b52b6463016e3f62 100644 (file)
@@ -185,7 +185,7 @@ Loop:
                                        l.backup()
                                        break Loop
                                } else if openQuoteFound {
-                                       // the coming quoute is inside
+                                       // the coming quote is inside
                                        escapedInnerQuoteFound = true
                                        escapedQuoteState = 1
                                }
index 19d068ece8716cc846cb35afc34e498040a1190f..7bfcfd698897b9b770e0c597adace3b174e85b46 100644 (file)
@@ -172,7 +172,7 @@ func (t *Iterator) PeekWalk(walkFn func(item Item) bool) {
        }
 }
 
-// Consume is a convencience method to consume the next n tokens,
+// Consume is a convenience method to consume the next n tokens,
 // but back off Errors and EOF.
 func (t *Iterator) Consume(cnt int) {
        for i := 0; i < cnt; i++ {
index 82846e3d033a057e89ac26b5566cbf75144a2296..ace5a78b4f13cbe0adf3f8730ceb546995f3795f 100644 (file)
@@ -140,7 +140,7 @@ func (w *cssClassCollectorWriter) Write(p []byte) (n int, err error) {
        return
 }
 
-// The net/html parser does not handle single table elemnts as input, e.g. tbody.
+// The net/html parser does not handle single table elements as input, e.g. tbody.
 // We only care about the element/class/ids, so just store away the original tag name
 // and pretend it's a <div>.
 func (c *cssClassCollectorWriter) insertStandinHTMLElement(el string) (string, string) {
index 61b9d211ffecff0c926c7c604904fe6cfcbbc2eb..97ffe1a2c33e7f8c9753509ac1e5552f568821bf 100644 (file)
@@ -131,12 +131,12 @@ func (r *ReleaseHandler) Run() error {
                return err
        }
 
-       prepareRelaseNotes := isPatch || relNotesState == releaseNotesNone
+       prepareReleaseNotes := isPatch || relNotesState == releaseNotesNone
        shouldRelease := isPatch || relNotesState == releaseNotesReady
 
        defer r.gitPush() // TODO(bep)
 
-       if prepareRelaseNotes || shouldRelease {
+       if prepareReleaseNotes || shouldRelease {
                gitCommits, err = getGitInfos(changeLogFromTag, "hugo", "", !r.try)
                if err != nil {
                        return err
@@ -150,11 +150,11 @@ func (r *ReleaseHandler) Run() error {
        }
 
        if relNotesState == releaseNotesCreated {
-               fmt.Println("Release notes created, but not ready. Reneame to *-ready.md to continue ...")
+               fmt.Println("Release notes created, but not ready. Rename to *-ready.md to continue ...")
                return nil
        }
 
-       if prepareRelaseNotes {
+       if prepareReleaseNotes {
                releaseNotesFile, err := r.writeReleaseNotesToTemp(version, isPatch, gitCommits, gitCommitsDocs)
                if err != nil {
                        return err
index ac0a0cc97888f99db7b8f70cc41128ad0283ff5c..ed303613f797af708baee7ea7d366ebcf21d50e3 100644 (file)
@@ -152,7 +152,7 @@ func (i *imageResource) cloneWithUpdates(u *transformationUpdate) (baseResource,
 
        var img *images.Image
 
-       if u.isContenChanged() {
+       if u.isContentChanged() {
                img = i.WithSpec(base)
        } else {
                img = i.Image
index 1888b457f59a7bd9d6d9625441c86f1895e24e69..1bb92b6ca189c751d5f533819f32ecebc38f008c 100644 (file)
@@ -46,7 +46,7 @@ func (c *imageCache) deleteIfContains(s string) {
        }
 }
 
-// The cache key is a lowecase path with Unix style slashes and it always starts with
+// The cache key is a lowercase path with Unix style slashes and it always starts with
 // a leading slash.
 func (c *imageCache) normalizeKey(key string) string {
        return "/" + c.normalizeKeyBase(key)
index 542ecb9b99fe3670adae0aa3d23fcfa936506cd3..9c186196002621978b0c3c6a9590ffb9218c42df 100644 (file)
@@ -354,7 +354,7 @@ func TestImageResizeInSubPath(t *testing.T) {
        assertImageFile(c, spec.BaseFs.PublishFs, publishedImageFilename, 101, 101)
        c.Assert(spec.BaseFs.PublishFs.Remove(publishedImageFilename), qt.IsNil)
 
-       // Cleare mem cache to simulate reading from the file cache.
+       // Clear mem cache to simulate reading from the file cache.
        spec.imageCache.clear()
 
        resizedAgain, err := image.Resize("101x101")
index ff3744c200c9f4fe7a8750bd1a6c78c93c3d4cd9..e1d83115b3cd1ae443b20c5b47355489fd3e76b3 100644 (file)
@@ -81,7 +81,7 @@ func generateMarshalJSON(c *codegen.Inspector) error {
 
        // Exclude these methods
        excludes := []reflect.Type{
-               // We need to eveluate the deprecated vs JSON in the future,
+               // We need to evaluate the deprecated vs JSON in the future,
                // but leave them out for now.
                pageInterfaceDeprecated,
 
@@ -146,7 +146,7 @@ func generateDeprecatedWrappers(c *codegen.Inspector) error {
                "Hugo":           "Use the global hugo function.",
                "LanguagePrefix": "Use .Site.LanguagePrefix.",
                "GetParam":       "Use .Param or .Params.myParam.",
-               "RSSLink": `Use the Output Format's link, e.g. something like: 
+               "RSSLink": `Use the Output Format's link, e.g. something like:
     {{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}`,
                "URL": "Use .Permalink or .RelPermalink. If what you want is the front matter URL value, use .Params.url",
        }
@@ -244,8 +244,8 @@ package page
 %s
 
 // ZeroFile represents a zero value of source.File with warnings if invoked.
-type zeroFile struct { 
-       log *helpers.DistinctLogger 
+type zeroFile struct {
+       log *helpers.DistinctLogger
 }
 
 func NewZeroFile(log *helpers.DistinctLogger) source.File {
index ff4213cc49b386a6647d2904e3cdec75f93f82a0..9eed8241e6ddd14918d838c2d301097893c228f3 100644 (file)
@@ -27,7 +27,7 @@ type OutputFormats []OutputFormat
 
 // OutputFormat links to a representation of a resource.
 type OutputFormat struct {
-       // Rel constains a value that can be used to construct a rel link.
+       // Rel contains a value that can be used to construct a rel link.
        // This is value is fetched from the output format definition.
        // Note that for pages with only one output format,
        // this method will always return "canonical".
index 07ccbfedd466bd5079251dd529ba15abc35b32c2..d4ca8ca4161591eb4a0efcbe9b3bea4eb3d52081 100644 (file)
@@ -343,7 +343,7 @@ func (p Pages) GroupByParamDate(key string, format string, order ...string) (Pag
        return p.groupByDateField(sorter, formatter, order...)
 }
 
-// ProbablyEq wraps comare.ProbablyEqer
+// ProbablyEq wraps compare.ProbablyEqer
 func (p PageGroup) ProbablyEq(other interface{}) bool {
        otherP, ok := other.(PageGroup)
        if !ok {
@@ -387,7 +387,7 @@ func (psg PagesGroup) Len() int {
        return l
 }
 
-// ProbablyEq wraps comare.ProbablyEqer
+// ProbablyEq wraps compare.ProbablyEqer
 func (psg PagesGroup) ProbablyEq(other interface{}) bool {
        otherPsg, ok := other.(PagesGroup)
        if !ok {
index ac69a8079f27cf22cf7e109abdb6f0d22b4d9617..dff784f5c1b0f3aca99c76a6726ffcd1654fb7d7 100644 (file)
@@ -104,7 +104,7 @@ func (p Pages) Len() int {
        return len(p)
 }
 
-// ProbablyEq wraps comare.ProbablyEqer
+// ProbablyEq wraps compare.ProbablyEqer
 func (pages Pages) ProbablyEq(other interface{}) bool {
        otherPages, ok := other.(Pages)
        if !ok {
index f30a55da59269724519a52f7e3362bda4c8ff9f6..753a3e41513394785ccd30a76356f1b4599027d9 100644 (file)
@@ -13,7 +13,7 @@
 
 package page
 
-// Next returns the next page reletive to the given
+// Next returns the next page relative to the given
 func (p Pages) Next(cur Page) Page {
        x := searchPage(cur, p)
        if x <= 0 {
index 026026572d583dd674513e3bd9c6f41779d6624a..bc3b8b55ab712075dab7ad5db6bb58acc54c9f35 100644 (file)
@@ -108,7 +108,7 @@ func (p Pages) withInvertedIndex(search func(idx *related.InvertedIndex) ([]rela
 
        d, ok := p[0].(InternalDependencies)
        if !ok {
-               return nil, errors.Errorf("invalid type %T in related serch", p[0])
+               return nil, errors.Errorf("invalid type %T in related search", p[0])
        }
 
        cache := d.GetRelatedDocsHandler()
index 64f9f12f385c967f5992f3673dec2b51053e5e73..28b9a8879caa628f89df04c9589584f947708a59 100644 (file)
@@ -440,7 +440,7 @@ func (l *genericResource) openDestinationsForWriting() (w io.WriteCloser, err er
 
                // Fast path:
                // This is a processed version of the original;
-               // check if it already existis at the destination.
+               // check if it already exists at the destination.
                for _, targetFilename := range targetFilenames {
                        if _, err := l.getSpec().BaseFs.PublishFs.Stat(targetFilename); err == nil {
                                continue
@@ -662,7 +662,7 @@ type resourcePathDescriptor struct {
        targetPathBuilder func() page.TargetPaths
 
        // This will normally be the same as above, but this will only apply to publishing
-       // of resources. It may be mulltiple values when in multihost mode.
+       // of resources. It may be multiple values when in multihost mode.
        baseTargetPathDirs []string
 
        // baseOffset is set when the output format's path has a offset, e.g. for AMP.
index 1659332ab1b4961feb239c88d43740c29a355593..c29d2eaf9918382463e9f65917bfc0e75c43672a 100644 (file)
@@ -274,7 +274,7 @@ func (r *Spec) newResource(sourceFs afero.Fs, fd ResourceSourceDescriptor) (reso
 
        ext := strings.ToLower(filepath.Ext(fd.RelTargetFilename))
        mimeType, found := r.MediaTypes.GetFirstBySuffix(strings.TrimPrefix(ext, "."))
-       // TODO(bep) we need to handle these ambigous types better, but in this context
+       // TODO(bep) we need to handle these ambiguous types better, but in this context
        // we most likely want the application/xml type.
        if mimeType.Suffix() == "xml" && mimeType.SubType == "rss" {
                mimeType, found = r.MediaTypes.GetByType("application/xml")
index bf7a945295dac2050c411f6455d09ac05037bb86..f015cd6c906355bad9f02f4bee4b0695f0679515 100644 (file)
@@ -41,7 +41,7 @@ func TestGenericResource(t *testing.T) {
        c.Assert(r.ResourceType(), qt.Equals, "css")
 }
 
-func TestGenericResourceWithLinkFacory(t *testing.T) {
+func TestGenericResourceWithLinkFactory(t *testing.T) {
        c := qt.New(t)
        spec := newTestResourceSpec(specDescriptor{c: c})
 
index a7598f820eec7a812eede856eb1d6dbbd15462d8..64d8667bd1af8fe22cec3f7989a8cc9d2808d8ab 100644 (file)
@@ -131,11 +131,11 @@ func (t *babelTransformation) Transform(ctx *resources.ResourceTransformationCtx
 
        configFile = filepath.Clean(configFile)
 
-       // We need an abolute filename to the config file.
+       // We need an absolute filename to the config file.
        if !filepath.IsAbs(configFile) {
                configFile = t.rs.BaseFs.ResolveJSConfigFile(configFile)
                if configFile == "" && t.options.Config != "" {
-                       // Only fail if the user specificed config file is not found.
+                       // Only fail if the user specified config file is not found.
                        return errors.Errorf("babel config %q not found:", configFile)
                }
        }
index 51a3f4047fa69ba79736d6d1e715acfc2c6657a8..972461e0e741f14eef3fd2a9088cdd49d81a7143 100644 (file)
@@ -20,7 +20,7 @@ import (
        "github.com/gohugoio/hugo/resources/resource"
 )
 
-// Client for minification of Resource objects. Supported minfiers are:
+// Client for minification of Resource objects. Supported minifiers are:
 // css, html, js, json, svg and xml.
 type Client struct {
        rs *resources.Spec
index 8ba40ebd143f6eba09ca5543e4fd54b493691231..27864b0c57f795d0eb51fadfc427f268681f7833 100644 (file)
@@ -166,11 +166,11 @@ func (t *postcssTransformation) Transform(ctx *resources.ResourceTransformationC
 
        configFile = filepath.Clean(configFile)
 
-       // We need an abolute filename to the config file.
+       // We need an absolute filename to the config file.
        if !filepath.IsAbs(configFile) {
                configFile = t.rs.BaseFs.ResolveJSConfigFile(configFile)
                if configFile == "" && t.options.Config != "" {
-                       // Only fail if the user specificed config file is not found.
+                       // Only fail if the user specified config file is not found.
                        return errors.Errorf("postcss config %q not found:", configFile)
                }
        }
index d995bb46b7aa09cab64a74486898ca518e0c578e..a9ec8467137cb11b36cd3b4ce9803891e8df1436 100644 (file)
@@ -105,7 +105,7 @@ type ResourceTransformationCtx struct {
        // to be simple types, as it needs to be serialized to JSON and back.
        Data map[string]interface{}
 
-       // This is used to publis additional artifacts, e.g. source maps.
+       // This is used to publish additional artifacts, e.g. source maps.
        // We may improve this.
        OpenResourcePublisher func(relTargetPath string) (io.WriteCloser, error)
 }
@@ -479,7 +479,7 @@ func (r *resourceAdapter) transform(publish, setContent bool) error {
                        publishwriters = append(publishwriters, metaw)
                }
 
-               // Any transofrmations reading from From must also write to To.
+               // Any transformations reading from From must also write to To.
                // This means that if the target buffer is empty, we can just reuse
                // the original reader.
                if b, ok := tctx.To.(*bytes.Buffer); ok && b.Len() > 0 {
@@ -587,7 +587,7 @@ type transformationUpdate struct {
        startCtx ResourceTransformationCtx
 }
 
-func (u *transformationUpdate) isContenChanged() bool {
+func (u *transformationUpdate) isContentChanged() bool {
        return u.content != nil || u.sourceFilename != nil
 }
 
index 4e78663157a562624cdb3e34cef16539808112ec..9e7e6df53c90f9e75384495da09448f768cbb63a 100644 (file)
@@ -152,7 +152,7 @@ func (fi *FileInfo) LogicalName() string { return fi.name }
 func (fi *FileInfo) BaseFileName() string { return fi.baseName }
 
 // TranslationBaseName returns a file's translation base name without the
-// language segement (ie. "page").
+// language segment (ie. "page").
 func (fi *FileInfo) TranslationBaseName() string { return fi.translationBaseName }
 
 // ContentBaseName is a either TranslationBaseName or name of containing folder
@@ -266,7 +266,7 @@ func (sp *SourceSpec) NewFileInfo(fi hugofs.FileMetaInfo) (*FileInfo, error) {
        baseName := helpers.Filename(name)
 
        if translationBaseName == "" {
-               // This is usyally provided by the filesystem. But this FileInfo is also
+               // This is usually provided by the filesystem. But this FileInfo is also
                // created in a standalone context when doing "hugo new". This is
                // an approximate implementation, which is "good enough" in that case.
                fileLangExt := filepath.Ext(baseName)
index a75ec9d16c08601c5e03047d24c25f6cf4b1d26b..a9bf9a09b35901e11a7d94240bfc7cb2e132b239 100644 (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{
index de59de0af9669570518f6b2638fad3d02b22e898..43815560f1d0494d648f28cdb957bc707a11b2c8 100644 (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) {
index 4798b50902ef921413a536e59ed2ca37614290ba..aa05b18749d590ed7fc38311aa149ae53c02ad7c 100644 (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}},
index 8ce5722736991ba1a95441f03421f0533e05fdfd..88b18f00cd4d6f011a753409574673427e6de4a7 100644 (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
index 7cd6df0fb410d581c0ea35192348e13be3bbf331..eed546e61aca67790bf76ca02fdbd8d96ab07ab3 100644 (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
index 2b2497c3e6468fa4ac1d3175d6378711cf0c9143..badc189c8c6abacd4aa311d31054acd91363da38 100644 (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 (
index 60cb658ba6dc3df10b65baaa0827771d777c8121..178d17bc0421d49f2a4e92a5f76e0a5a458633f3 100644 (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 {
index 73db9b3a6de91f82de726f901475b4a2de138692..0375b4a1776f5dfedd57f4d7233f05097e5f940e 100644 (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()
 }
index 3f7cc025755bf42081aac2012489f7dd2f679946..09a253e2939835ef58d4ec5888781da52be8557a 100644 (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
                }
index 652256f4415c7ef6eea03b277b3e55f5ab1efc58..1bba636adfb9e3b5a4be4900eacc29c79243dd80 100644 (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]
index af3ae61d6d2b25efe86cae114c48c883fae56d90..78b288e97b95863dfc344eadabb70532045882bf 100644 (file)
@@ -30,7 +30,7 @@ func TestChainZeroTransformers(t *testing.T) {
        }
 }
 
-func TestChaingMultipleTransformers(t *testing.T) {
+func TestChainingMultipleTransformers(t *testing.T) {
        f1 := func(ct FromTo) error {
                _, err := ct.To().Write(bytes.Replace(ct.From().Bytes(), []byte("f1"), []byte("f1r"), -1))
                return err
index f4aa8b8aee0361e7881d96fee0a2c29e9e58572c..f57716c0dc168fb09db1f75109c79ddd59ef446e 100644 (file)
@@ -28,10 +28,10 @@ const (
        h5JsContentSingleQuote      = "<!DOCTYPE html><html><head><script src='foobar.js'></script><script src='/barfoo.js'></script></head><body><nav><h1>title</h1></nav><article>content <a href='foobar'>foobar</a>. <a href='/foobar'>Follow up</a></article></body></html>"
        h5JsContentAbsURL           = "<!DOCTYPE html><html><head><script src=\"http://user@host:10234/foobar.js\"></script></head><body><nav><h1>title</h1></nav><article>content <a href=\"https://host/foobar\">foobar</a>. Follow up</article></body></html>"
        h5JsContentAbsURLSchemaless = "<!DOCTYPE html><html><head><script src=\"//host/foobar.js\"></script><script src='//host2/barfoo.js'></head><body><nav><h1>title</h1></nav><article>content <a href=\"//host/foobar\">foobar</a>. <a href='//host2/foobar'>Follow up</a></article></body></html>"
-       corectOutputSrcHrefDq       = "<!DOCTYPE html><html><head><script src=\"foobar.js\"></script><script src=\"http://base/barfoo.js\"></script></head><body><nav><h1>title</h1></nav><article>content <a href=\"foobar\">foobar</a>. <a href=\"http://base/foobar\">Follow up</a></article></body></html>"
-       corectOutputSrcHrefSq       = "<!DOCTYPE html><html><head><script src='foobar.js'></script><script src='http://base/barfoo.js'></script></head><body><nav><h1>title</h1></nav><article>content <a href='foobar'>foobar</a>. <a href='http://base/foobar'>Follow up</a></article></body></html>"
+       correctOutputSrcHrefDq      = "<!DOCTYPE html><html><head><script src=\"foobar.js\"></script><script src=\"http://base/barfoo.js\"></script></head><body><nav><h1>title</h1></nav><article>content <a href=\"foobar\">foobar</a>. <a href=\"http://base/foobar\">Follow up</a></article></body></html>"
+       correctOutputSrcHrefSq      = "<!DOCTYPE html><html><head><script src='foobar.js'></script><script src='http://base/barfoo.js'></script></head><body><nav><h1>title</h1></nav><article>content <a href='foobar'>foobar</a>. <a href='http://base/foobar'>Follow up</a></article></body></html>"
 
-       h5XMLXontentAbsURL        = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?><feed xmlns=\"http://www.w3.org/2005/Atom\"><entry><content type=\"html\">&lt;p&gt;&lt;a href=&#34;/foobar&#34;&gt;foobar&lt;/a&gt;&lt;/p&gt; &lt;p&gt;A video: &lt;iframe src=&#39;/foo&#39;&gt;&lt;/iframe&gt;&lt;/p&gt;</content></entry></feed>"
+       h5XMLContentAbsURL        = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?><feed xmlns=\"http://www.w3.org/2005/Atom\"><entry><content type=\"html\">&lt;p&gt;&lt;a href=&#34;/foobar&#34;&gt;foobar&lt;/a&gt;&lt;/p&gt; &lt;p&gt;A video: &lt;iframe src=&#39;/foo&#39;&gt;&lt;/iframe&gt;&lt;/p&gt;</content></entry></feed>"
        correctOutputSrcHrefInXML = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?><feed xmlns=\"http://www.w3.org/2005/Atom\"><entry><content type=\"html\">&lt;p&gt;&lt;a href=&#34;http://base/foobar&#34;&gt;foobar&lt;/a&gt;&lt;/p&gt; &lt;p&gt;A video: &lt;iframe src=&#39;http://base/foo&#39;&gt;&lt;/iframe&gt;&lt;/p&gt;</content></entry></feed>"
        h5XMLContentGuarded       = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?><feed xmlns=\"http://www.w3.org/2005/Atom\"><entry><content type=\"html\">&lt;p&gt;&lt;a href=&#34;//foobar&#34;&gt;foobar&lt;/a&gt;&lt;/p&gt; &lt;p&gt;A video: &lt;iframe src=&#39;//foo&#39;&gt;&lt;/iframe&gt;&lt;/p&gt;</content></entry></feed>"
 )
@@ -60,30 +60,30 @@ const (
        srcsetXMLBasicCorrect       = `Pre. <img srcset=&#34;http://base/img/small.jpg 200w, http://base/img/big.jpg 700w&#34; alt=&#34;text&#34; src=&#34;http://base/img/foo.jpg&#34;>`
        srcsetXMLSingleQuote        = `Pre. <img srcset=&#34;/img/small.jpg 200w, /img/big.jpg 700w&#34; alt=&#34;text&#34; src=&#34;/img/foo.jpg&#34;>`
        srcsetXMLSingleQuoteCorrect = `Pre. <img srcset=&#34;http://base/img/small.jpg 200w, http://base/img/big.jpg 700w&#34; alt=&#34;text&#34; src=&#34;http://base/img/foo.jpg&#34;>`
-       srcsetVariations            = `Pre. 
-Missing start quote: <img srcset=/img/small.jpg 200w, /img/big.jpg 700w" alt="text"> src='/img/foo.jpg'> FOO. 
-<img srcset='/img.jpg'> 
+       srcsetVariations            = `Pre.
+Missing start quote: <img srcset=/img/small.jpg 200w, /img/big.jpg 700w" alt="text"> src='/img/foo.jpg'> FOO.
+<img srcset='/img.jpg'>
 schemaless: <img srcset='//img.jpg' src='//basic.jpg'>
 schemaless2: <img srcset="//img.jpg" src="//basic.jpg2> POST
 `
 )
 
 const (
-       srcsetVariationsCorrect = `Pre. 
-Missing start quote: <img srcset=/img/small.jpg 200w, /img/big.jpg 700w" alt="text"> src='http://base/img/foo.jpg'> FOO. 
-<img srcset='http://base/img.jpg'> 
+       srcsetVariationsCorrect = `Pre.
+Missing start quote: <img srcset=/img/small.jpg 200w, /img/big.jpg 700w" alt="text"> src='http://base/img/foo.jpg'> FOO.
+<img srcset='http://base/img.jpg'>
 schemaless: <img srcset='//img.jpg' src='//basic.jpg'>
 schemaless2: <img srcset="//img.jpg" src="//basic.jpg2> POST
 `
-       srcsetXMLVariations = `Pre. 
-Missing start quote: &lt;img srcset=/img/small.jpg 200w /img/big.jpg 700w&quot; alt=&quot;text&quot;&gt; src=&#39;/img/foo.jpg&#39;&gt; FOO. 
-&lt;img srcset=&#39;/img.jpg&#39;&gt; 
+       srcsetXMLVariations = `Pre.
+Missing start quote: &lt;img srcset=/img/small.jpg 200w /img/big.jpg 700w&quot; alt=&quot;text&quot;&gt; src=&#39;/img/foo.jpg&#39;&gt; FOO.
+&lt;img srcset=&#39;/img.jpg&#39;&gt;
 schemaless: &lt;img srcset=&#39;//img.jpg&#39; src=&#39;//basic.jpg&#39;&gt;
 schemaless2: &lt;img srcset=&quot;//img.jpg&quot; src=&quot;//basic.jpg2&gt; POST
 `
-       srcsetXMLVariationsCorrect = `Pre. 
-Missing start quote: &lt;img srcset=/img/small.jpg 200w /img/big.jpg 700w&quot; alt=&quot;text&quot;&gt; src=&#39;http://base/img/foo.jpg&#39;&gt; FOO. 
-&lt;img srcset=&#39;http://base/img.jpg&#39;&gt; 
+       srcsetXMLVariationsCorrect = `Pre.
+Missing start quote: &lt;img srcset=/img/small.jpg 200w /img/big.jpg 700w&quot; alt=&quot;text&quot;&gt; src=&#39;http://base/img/foo.jpg&#39;&gt; FOO.
+&lt;img srcset=&#39;http://base/img.jpg&#39;&gt;
 schemaless: &lt;img srcset=&#39;//img.jpg&#39; src=&#39;//basic.jpg&#39;&gt;
 schemaless2: &lt;img srcset=&quot;//img.jpg&quot; src=&quot;//basic.jpg2&gt; POST
 `
@@ -96,14 +96,14 @@ schemaless2: &lt;img srcset=&quot;//img.jpg&quot; src=&quot;//basic.jpg2&gt; POS
 
 var (
        absURLlBenchTests = []test{
-               {h5JsContentDoubleQuote, corectOutputSrcHrefDq},
-               {h5JsContentSingleQuote, corectOutputSrcHrefSq},
+               {h5JsContentDoubleQuote, correctOutputSrcHrefDq},
+               {h5JsContentSingleQuote, correctOutputSrcHrefSq},
                {h5JsContentAbsURL, h5JsContentAbsURL},
                {h5JsContentAbsURLSchemaless, h5JsContentAbsURLSchemaless},
        }
 
        xmlAbsURLBenchTests = []test{
-               {h5XMLXontentAbsURL, correctOutputSrcHrefInXML},
+               {h5XMLContentAbsURL, correctOutputSrcHrefInXML},
                {h5XMLContentGuarded, h5XMLContentGuarded},
        }
 
@@ -155,7 +155,7 @@ func TestAbsURL(t *testing.T) {
        apply(t.Errorf, tr, absURLTests)
 }
 
-func TestAbsURLUnqoted(t *testing.T) {
+func TestAbsURLUnquoted(t *testing.T) {
        tr := transform.New(NewAbsURLTransformer(testBaseURL))
 
        apply(t.Errorf, tr, []test{