From f9559f004b321676a7c0aa213ac8668ededd2c5d Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Wed, 17 May 2023 23:00:11 +0300 Subject: [PATCH] Fix typos in comments --- examples/authenticated-api/echo/server/fake_jws.go | 2 +- pkg/chi-middleware/oapi_validate.go | 2 +- pkg/codegen/codegen_test.go | 6 +++--- pkg/codegen/utils.go | 2 +- pkg/runtime/bindstring.go | 2 +- pkg/util/inputmapping.go | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/authenticated-api/echo/server/fake_jws.go b/examples/authenticated-api/echo/server/fake_jws.go index 928b2dc048..0cf44e0d90 100644 --- a/examples/authenticated-api/echo/server/fake_jws.go +++ b/examples/authenticated-api/echo/server/fake_jws.go @@ -74,7 +74,7 @@ func (f *FakeAuthenticator) ValidateJWS(jwsString string) (jwt.Token, error) { jwt.WithAudience(FakeAudience), jwt.WithIssuer(FakeIssuer)) } -// SignToken takes a JWT and signs it with our priviate key, returning a JWS. +// SignToken takes a JWT and signs it with our private key, returning a JWS. func (f *FakeAuthenticator) SignToken(t jwt.Token) ([]byte, error) { hdr := jws.NewHeaders() if err := hdr.Set(jws.AlgorithmKey, jwa.ES256); err != nil { diff --git a/pkg/chi-middleware/oapi_validate.go b/pkg/chi-middleware/oapi_validate.go index c09c2f1e28..b654dc3cf6 100644 --- a/pkg/chi-middleware/oapi_validate.go +++ b/pkg/chi-middleware/oapi_validate.go @@ -1,6 +1,6 @@ // Package middleware implements middleware function for go-chi or net/http, // which validates incoming HTTP requests to make sure that they conform to the given OAPI 3.0 specification. -// When OAPI validation failes on the request, we return an HTTP/400. +// When OAPI validation fails on the request, we return an HTTP/400. package middleware import ( diff --git a/pkg/codegen/codegen_test.go b/pkg/codegen/codegen_test.go index 32b2466afa..a127bf0a28 100644 --- a/pkg/codegen/codegen_test.go +++ b/pkg/codegen/codegen_test.go @@ -109,7 +109,7 @@ func TestExamplePetStoreCodeGenerationWithUserTemplates(t *testing.T) { // Check that we have a package: assert.Contains(t, code, "package api") - // Check that the built-in template has been overriden + // Check that the built-in template has been overridden assert.Contains(t, code, "//blah") } @@ -145,7 +145,7 @@ func TestExamplePetStoreCodeGenerationWithFileUserTemplates(t *testing.T) { // Check that we have a package: assert.Contains(t, code, "package api") - // Check that the built-in template has been overriden + // Check that the built-in template has been overridden assert.Contains(t, code, "// Package api provides primitives to interact with the openapi") } @@ -194,7 +194,7 @@ func TestExamplePetStoreCodeGenerationWithHTTPUserTemplates(t *testing.T) { // Check that we have a package: assert.Contains(t, code, "package api") - // Check that the built-in template has been overriden + // Check that the built-in template has been overridden assert.Contains(t, code, "//blah") } diff --git a/pkg/codegen/utils.go b/pkg/codegen/utils.go index cfca21e74c..6fb031e49c 100644 --- a/pkg/codegen/utils.go +++ b/pkg/codegen/utils.go @@ -521,7 +521,7 @@ func IsGoKeyword(str string) bool { } // IsPredeclaredGoIdentifier returns whether the given string -// is a predefined go indentifier. +// is a predefined go identifier. // // See https://golang.org/ref/spec#Predeclared_identifiers func IsPredeclaredGoIdentifier(str string) bool { diff --git a/pkg/runtime/bindstring.go b/pkg/runtime/bindstring.go index 72f74dd1bf..efc98670fc 100644 --- a/pkg/runtime/bindstring.go +++ b/pkg/runtime/bindstring.go @@ -42,7 +42,7 @@ func BindStringToObject(src string, dst interface{}) error { t = v.Type() } - // For some optioinal args + // For some optional args if t.Kind() == reflect.Ptr { if v.IsNil() { v.Set(reflect.New(t.Elem())) diff --git a/pkg/util/inputmapping.go b/pkg/util/inputmapping.go index fb2ac756aa..7b475dbdd7 100644 --- a/pkg/util/inputmapping.go +++ b/pkg/util/inputmapping.go @@ -5,7 +5,7 @@ import ( "strings" ) -// The input mapping is experessed on the command line as `key1:value1,key2:value2,...` +// The input mapping is expressed on the command line as `key1:value1,key2:value2,...` // We parse it here, but need to keep in mind that keys or values may contain // commas and colons. We will allow escaping those using double quotes, so // when passing in "key1":"value1", we will not look inside the quoted sections. @@ -47,7 +47,7 @@ func ParseCommandLineList(input string) []string { return args } -// This function splits a string along the specifed separator, but it +// This function splits a string along the specified separator, but it // ignores anything between double quotes for splitting. We do simple // inside/outside quote counting. Quotes are not stripped from output. func splitString(s string, sep rune) []string {