From 942cdae41d74c38cdac67d61e16c7022f9afdf69 Mon Sep 17 00:00:00 2001 From: Gregor Fischer Date: Sat, 25 Oct 2025 03:28:40 +0200 Subject: [PATCH] Fix typos in comments and messages (#5254) --- tools/goctl/api/dartgen/vars.go | 4 ++-- tools/goctl/api/parser/g4/ast/service.go | 4 ++-- tools/goctl/api/parser/g4/ast/type.go | 2 +- tools/goctl/api/parser/parser.go | 8 ++++---- tools/goctl/model/sql/test/sqlconn.go | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/goctl/api/dartgen/vars.go b/tools/goctl/api/dartgen/vars.go index c34d364a4..2488c5153 100644 --- a/tools/goctl/api/dartgen/vars.go +++ b/tools/goctl/api/dartgen/vars.go @@ -32,7 +32,7 @@ import '../vars/vars.dart'; /// Send GET request. /// /// ok: the function that will be called on success. -/// fail:the fuction that will be called on failure. +/// fail:the function that will be called on failure. /// eventually:the function that will be called regardless of success or failure. Future apiGet(String path, {Map header, @@ -47,7 +47,7 @@ Future apiGet(String path, /// /// data: the data to post, it will be marshaled to json automatically. /// ok: the function that will be called on success. -/// fail:the fuction that will be called on failure. +/// fail:the function that will be called on failure. /// eventually:the function that will be called regardless of success or failure. Future apiPost(String path, dynamic data, {Map header, diff --git a/tools/goctl/api/parser/g4/ast/service.go b/tools/goctl/api/parser/g4/ast/service.go index fb760ec2d..70b48373c 100644 --- a/tools/goctl/api/parser/g4/ast/service.go +++ b/tools/goctl/api/parser/g4/ast/service.go @@ -268,7 +268,7 @@ func (v *ApiVisitor) VisitReplybody(ctx *api.ReplybodyContext) any { v.panic(lit.Expr(), fmt.Sprintf("expecting 'ID', but found golang keyword '%s'", lit.Expr().Text())) } default: - v.panic(dt.Expr(), fmt.Sprintf("unsupport %s", dt.Expr().Text())) + v.panic(dt.Expr(), fmt.Sprintf("unsupported %s", dt.Expr().Text())) } case *Literal: lit := dataType.Literal.Text() @@ -276,7 +276,7 @@ func (v *ApiVisitor) VisitReplybody(ctx *api.ReplybodyContext) any { v.panic(dataType.Literal, fmt.Sprintf("expecting 'ID', but found golang keyword '%s'", lit)) } default: - v.panic(dt.Expr(), fmt.Sprintf("unsupport %s", dt.Expr().Text())) + v.panic(dt.Expr(), fmt.Sprintf("unsupported %s", dt.Expr().Text())) } return &Body{ diff --git a/tools/goctl/api/parser/g4/ast/type.go b/tools/goctl/api/parser/g4/ast/type.go index 7fe1202ae..f0cadf9b2 100644 --- a/tools/goctl/api/parser/g4/ast/type.go +++ b/tools/goctl/api/parser/g4/ast/type.go @@ -190,7 +190,7 @@ func (v *ApiVisitor) VisitTypeBlockStruct(ctx *api.TypeBlockStructContext) any { structExpr := v.newExprWithToken(ctx.GetStructToken()) structTokenText := ctx.GetStructToken().GetText() if structTokenText != "struct" { - v.panic(structExpr, fmt.Sprintf("expecting 'struct', found imput '%s'", structTokenText)) + v.panic(structExpr, fmt.Sprintf("expecting 'struct', found input '%s'", structTokenText)) } if api.IsGolangKeyWord(structTokenText, "struct") { diff --git a/tools/goctl/api/parser/parser.go b/tools/goctl/api/parser/parser.go index 7c3642325..a41c0044b 100644 --- a/tools/goctl/api/parser/parser.go +++ b/tools/goctl/api/parser/parser.go @@ -18,7 +18,7 @@ type parser struct { } // Parse parses the api file. -// Depreacted: use tools/goctl/pkg/parser/api/parser/parser.go:18 instead, +// Deprecated: use tools/goctl/pkg/parser/api/parser/parser.go:18 instead, // it will be removed in the future. func Parse(filename string) (*spec.ApiSpec, error) { if env.UseExperimental() { @@ -63,14 +63,14 @@ func parseContent(content string, skipCheckTypeDeclaration bool, filename ...str return apiSpec, nil } -// Depreacted: use tools/goctl/pkg/parser/api/parser/parser.go:18 instead, +// Deprecated: use tools/goctl/pkg/parser/api/parser/parser.go:18 instead, // it will be removed in the future. // ParseContent parses the api content func ParseContent(content string, filename ...string) (*spec.ApiSpec, error) { return parseContent(content, false, filename...) } -// Depreacted: use tools/goctl/pkg/parser/api/parser/parser.go:18 instead, +// Deprecated: use tools/goctl/pkg/parser/api/parser/parser.go:18 instead, // it will be removed in the future. // ParseContentWithParserSkipCheckTypeDeclaration parses the api content with skip check type declaration func ParseContentWithParserSkipCheckTypeDeclaration(content string, filename ...string) (*spec.ApiSpec, error) { @@ -227,7 +227,7 @@ func (p parser) astTypeToSpec(in ast.DataType) spec.Type { return spec.PointerType{RawName: v.PointerExpr.Text(), Type: spec.DefineStruct{RawName: raw}} } - panic(fmt.Sprintf("unspported type %+v", in)) + panic(fmt.Sprintf("unsupported type %+v", in)) } func (p parser) stringExprs(docs []ast.Expr) []string { diff --git a/tools/goctl/model/sql/test/sqlconn.go b/tools/goctl/model/sql/test/sqlconn.go index da90d9ff4..748f3b108 100644 --- a/tools/goctl/model/sql/test/sqlconn.go +++ b/tools/goctl/model/sql/test/sqlconn.go @@ -99,12 +99,12 @@ func (conn *MockConn) RawDB() (*sql.DB, error) { return conn.db, nil } -// Transact is the implemention of sqlx.SqlConn, nothing to do +// Transact is the implementation of sqlx.SqlConn, nothing to do func (conn *MockConn) Transact(func(session sqlx.Session) error) error { return nil } -// TransactCtx is the implemention of sqlx.SqlConn, nothing to do +// TransactCtx is the implementation of sqlx.SqlConn, nothing to do func (conn *MockConn) TransactCtx(ctx context.Context, fn func(context.Context, sqlx.Session) error) error { return nil }