From 5af3de93981e7547d1ebbe8c84331aa9783c06af Mon Sep 17 00:00:00 2001 From: Zhizhen He Date: Tue, 14 Mar 2023 22:40:55 +0800 Subject: [PATCH] Fix typo Signed-off-by: Zhizhen He --- cmd/ytt-lambda-website/request.go | 2 +- examples/k8s-overlay-ingress/ReadMe.md | 2 +- .../example-overlay-data-values/__readme.yaml | 6 +++--- pkg/filepos/position.go | 8 ++++---- pkg/texttemplate/metas.go | 2 +- pkg/texttemplate/template.go | 2 +- pkg/yamlmeta/internal/yaml.v2/scannerc.go | 4 ++-- pkg/yamlmeta/internal/yaml.v2/yaml.go | 2 +- pkg/yamlmeta/internal/yaml.v2/yamlh.go | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/cmd/ytt-lambda-website/request.go b/cmd/ytt-lambda-website/request.go index 32dad95d..4767c5d9 100644 --- a/cmd/ytt-lambda-website/request.go +++ b/cmd/ytt-lambda-website/request.go @@ -22,7 +22,7 @@ import ( // a protocol: http://my-custom.host.com const CustomHostVariable = "GO_API_HOST" -// DefaultServerAddress is prepended to the path of each incoming reuqest +// DefaultServerAddress is prepended to the path of each incoming request const DefaultServerAddress = "https://aws-serverless-go-api.com" type RequestAccessor struct { diff --git a/examples/k8s-overlay-ingress/ReadMe.md b/examples/k8s-overlay-ingress/ReadMe.md index ef7a8930..7e1ff402 100644 --- a/examples/k8s-overlay-ingress/ReadMe.md +++ b/examples/k8s-overlay-ingress/ReadMe.md @@ -3,7 +3,7 @@ This example shows how to use `ytt` overlaying in regards to accomplish the modi Specifically the `apiVersion` is bumped to **networking.k8s.io/v1** from **networking.k8s.io/v1beta1**. This is done in order to get the Falco installation Helm post-rendered into a state that matches the version of the `networking` API on a specific `Kubernetes` version. As a consequence of that we're required to `ytt overlay` **backend** and **paths** on the **Kubernetes Ingress Object**. In order for these to match the `apiVersion` that is overlayed to. -All of this stems from the Falco Helm chart having issues with the version tag that K3s uses. It's e.g `v1.22.3+k3s2`. This results in the **Falco** chart using the **v1beta1** of the **networking** API instead of the newest versio of the **networking** API that we want. +All of this stems from the Falco Helm chart having issues with the version tag that K3s uses. It's e.g `v1.22.3+k3s2`. This results in the **Falco** chart using the **v1beta1** of the **networking** API instead of the newest version of the **networking** API that we want. The cmdline used: diff --git a/examples/playground/getting-started/example-overlay-data-values/__readme.yaml b/examples/playground/getting-started/example-overlay-data-values/__readme.yaml index e8e86b2b..2ea51591 100644 --- a/examples/playground/getting-started/example-overlay-data-values/__readme.yaml +++ b/examples/playground/getting-started/example-overlay-data-values/__readme.yaml @@ -58,7 +58,7 @@ readme: | Add a new value to `prod/values.yml`: ``` - app_nmae: prometheus-operator-blue + app_name: prometheus-operator-blue ``` ytt error messages are information dense: @@ -66,8 +66,8 @@ readme: | - lists the order in which data values are being applied; - that in `prod/values.yml`, the problem is... ...in the YAML Document starting on line 2 - ...at the Map item named "app_nmae" on line 4 - - where "app_nmae" was expected to be a node in the data + ...at the Map item named "app_name" on line 4 + - where "app_name" was expected to be a node in the data value YAML tree, already, but it wasn't. Consider: what would have happened if ytt had — instead — diff --git a/pkg/filepos/position.go b/pkg/filepos/position.go index 1582dd50..1b08ae9d 100644 --- a/pkg/filepos/position.go +++ b/pkg/filepos/position.go @@ -121,10 +121,10 @@ func (p *Position) DeepCopyWithLineOffset(offset int) *Position { } // IsNextTo compares the location of one position with another. -func (p *Position) IsNextTo(otherPostion *Position) bool { - if p.IsKnown() && otherPostion.IsKnown() { - if p.GetFile() == otherPostion.GetFile() { - diff := p.LineNum() - otherPostion.LineNum() +func (p *Position) IsNextTo(otherPosition *Position) bool { + if p.IsKnown() && otherPosition.IsKnown() { + if p.GetFile() == otherPosition.GetFile() { + diff := p.LineNum() - otherPosition.LineNum() if -1 <= diff && 1 >= diff { return true } diff --git a/pkg/texttemplate/metas.go b/pkg/texttemplate/metas.go index 1705f411..843ed2e0 100644 --- a/pkg/texttemplate/metas.go +++ b/pkg/texttemplate/metas.go @@ -11,7 +11,7 @@ type NodeCodeMeta struct { *NodeCode } -func (p NodeCodeMeta) ShoudTrimSpaceLeft() bool { +func (p NodeCodeMeta) ShouldTrimSpaceLeft() bool { return strings.HasPrefix(p.Content, "-") } diff --git a/pkg/texttemplate/template.go b/pkg/texttemplate/template.go index 0f35767a..8d05a436 100644 --- a/pkg/texttemplate/template.go +++ b/pkg/texttemplate/template.go @@ -80,7 +80,7 @@ func (e *Template) compile(rootNode *NodeRoot, meta := NodeCodeMeta{typedNode} trimSpaceRight = meta.ShouldTrimSpaceRight() - if meta.ShoudTrimSpaceLeft() && i != 0 { + if meta.ShouldTrimSpaceLeft() && i != 0 { if typedLastNode, ok := rootNode.Items[i-1].(*NodeText); ok { typedLastNode.Content = strings.TrimRightFunc( typedLastNode.Content, unicode.IsSpace) diff --git a/pkg/yamlmeta/internal/yaml.v2/scannerc.go b/pkg/yamlmeta/internal/yaml.v2/scannerc.go index 8662b99d..1879ed8a 100644 --- a/pkg/yamlmeta/internal/yaml.v2/scannerc.go +++ b/pkg/yamlmeta/internal/yaml.v2/scannerc.go @@ -78,7 +78,7 @@ import ( // %TAG !yaml! tag:yaml.org,2002: // --- // -// The correspoding sequence of tokens: +// The corresponding sequence of tokens: // // STREAM-START(utf-8) // VERSION-DIRECTIVE(1,1) @@ -1233,7 +1233,7 @@ func yamlParserFetchKey(parser *yamlParserT) bool { // In the block context, additional checks are required. if parser.flowLevel == 0 { - // Check if we are allowed to start a new key (not nessesary simple). + // Check if we are allowed to start a new key (not necessary simple). if !parser.simpleKeyAllowed { return yamlParserSetScannerError(parser, "", parser.mark, "mapping keys are not allowed in this context") diff --git a/pkg/yamlmeta/internal/yaml.v2/yaml.go b/pkg/yamlmeta/internal/yaml.v2/yaml.go index 15202a6c..a3e2b13c 100644 --- a/pkg/yamlmeta/internal/yaml.v2/yaml.go +++ b/pkg/yamlmeta/internal/yaml.v2/yaml.go @@ -104,7 +104,7 @@ func UnmarshalWithComments(in []byte, out interface{}) ([]Comment, error) { return unmarshal(in, out, true) } -// A Decorder reads and decodes YAML values from an input stream. +// Decoder reads and decodes YAML values from an input stream. type Decoder struct { strict bool useMapSlice bool diff --git a/pkg/yamlmeta/internal/yaml.v2/yamlh.go b/pkg/yamlmeta/internal/yaml.v2/yamlh.go index 055cdee9..238b85b4 100644 --- a/pkg/yamlmeta/internal/yaml.v2/yamlh.go +++ b/pkg/yamlmeta/internal/yaml.v2/yamlh.go @@ -726,7 +726,7 @@ type yamlEmitterT struct { scalarData struct { value []byte // The scalar value. multiline bool // Does the scalar contain line breaks? - flowPlainAllowed bool // Can the scalar be expessed in the flow plain style? + flowPlainAllowed bool // Can the scalar be expressed in the flow plain style? blockPlainAllowed bool // Can the scalar be expressed in the block plain style? singleQuotedAllowed bool // Can the scalar be expressed in the single quoted style? blockAllowed bool // Can the scalar be expressed in the literal or folded styles?