From 60a01d044a5b3f65b9eea866954fdeea1e7d3f00 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Wed, 17 Apr 2024 16:49:20 +0300 Subject: [PATCH] Fix typos in doc comments --- conn.go | 2 +- pgconn/config.go | 2 +- pgconn/errors.go | 2 +- pgconn/errors_test.go | 2 +- pgproto3/pgproto3.go | 2 +- pgtype/pgtype.go | 2 +- values_test.go | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/conn.go b/conn.go index fc72c732e..a9cb3163f 100644 --- a/conn.go +++ b/conn.go @@ -624,7 +624,7 @@ const ( // to execute. It does not use named prepared statements. But it does use the unnamed prepared statement to get the // statement description on the first round trip and then uses it to execute the query on the second round trip. This // may cause problems with connection poolers that switch the underlying connection between round trips. It is safe - // even when the the database schema is modified concurrently. + // even when the database schema is modified concurrently. QueryExecModeDescribeExec // Assume the PostgreSQL query parameter types based on the Go type of the arguments. This uses the extended protocol diff --git a/pgconn/config.go b/pgconn/config.go index 33a722579..13def1e80 100644 --- a/pgconn/config.go +++ b/pgconn/config.go @@ -70,7 +70,7 @@ type Config struct { // ParseConfigOptions contains options that control how a config is built such as GetSSLPassword. type ParseConfigOptions struct { - // GetSSLPassword gets the password to decrypt a SSL client certificate. This is analogous to the the libpq function + // GetSSLPassword gets the password to decrypt a SSL client certificate. This is analogous to the libpq function // PQsetSSLKeyPassHook_OpenSSL. GetSSLPassword GetSSLPasswordFunc } diff --git a/pgconn/errors.go b/pgconn/errors.go index 1bc386c3f..6790b9b6a 100644 --- a/pgconn/errors.go +++ b/pgconn/errors.go @@ -18,7 +18,7 @@ func SafeToRetry(err error) bool { return false } -// Timeout checks if err was was caused by a timeout. To be specific, it is true if err was caused within pgconn by a +// Timeout checks if err was caused by a timeout. To be specific, it is true if err was caused within pgconn by a // context.DeadlineExceeded or an implementer of net.Error where Timeout() is true. func Timeout(err error) bool { var timeoutErr *errTimeout diff --git a/pgconn/errors_test.go b/pgconn/errors_test.go index 9d5593465..171445cc0 100644 --- a/pgconn/errors_test.go +++ b/pgconn/errors_test.go @@ -30,7 +30,7 @@ func TestConfigError(t *testing.T) { }, { name: "weird url", - err: pgconn.NewParseConfigError("postgresql://foo::pasword@host:1:", "msg", nil), + err: pgconn.NewParseConfigError("postgresql://foo::password@host:1:", "msg", nil), expectedMsg: "cannot parse `postgresql://foo:xxxxx@host:1:`: msg", }, { diff --git a/pgproto3/pgproto3.go b/pgproto3/pgproto3.go index 480abfc06..128f97f87 100644 --- a/pgproto3/pgproto3.go +++ b/pgproto3/pgproto3.go @@ -99,7 +99,7 @@ func getValueFromJSON(v map[string]string) ([]byte, error) { return nil, errors.New("unknown protocol representation") } -// beginMessage begines a new message of type t. It appends the message type and a placeholder for the message length to +// beginMessage begins a new message of type t. It appends the message type and a placeholder for the message length to // dst. It returns the new buffer and the position of the message length placeholder. func beginMessage(dst []byte, t byte) ([]byte, int) { dst = append(dst, t) diff --git a/pgtype/pgtype.go b/pgtype/pgtype.go index d23ebc6c9..2be11e820 100644 --- a/pgtype/pgtype.go +++ b/pgtype/pgtype.go @@ -1331,7 +1331,7 @@ func (plan *derefPointerEncodePlan) Encode(value any, buf []byte) (newBuf []byte } // TryWrapDerefPointerEncodePlan tries to dereference a pointer. e.g. If value was of type *string then a wrapper plan -// would be returned that derefences the value. +// would be returned that dereferences the value. func TryWrapDerefPointerEncodePlan(value any) (plan WrappedEncodePlanNextSetter, nextValue any, ok bool) { if _, ok := value.(driver.Valuer); ok { return nil, nil, false diff --git a/values_test.go b/values_test.go index 5369b836c..132b79a2a 100644 --- a/values_test.go +++ b/values_test.go @@ -216,7 +216,7 @@ func testJSONInt16ArrayFailureDueToOverflow(t *testing.T, conn *pgx.Conn, typena var output []int16 err := conn.QueryRow(context.Background(), "select $1::"+typename, input).Scan(&output) if err == nil || err.Error() != "can't scan into dest[0]: json: cannot unmarshal number 234432 into Go value of type int16" { - t.Errorf("%s: Expected *json.UnmarkalTypeError, but got %v", typename, err) + t.Errorf("%s: Expected *json.UnmarshalTypeError, but got %v", typename, err) } }