Skip to content

Commit 942cdae

Browse files
authored
Fix typos in comments and messages (#5254)
1 parent e9c3607 commit 942cdae

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

tools/goctl/api/dartgen/vars.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import '../vars/vars.dart';
3232
/// Send GET request.
3333
///
3434
/// ok: the function that will be called on success.
35-
/// fail:the fuction that will be called on failure.
35+
/// fail:the function that will be called on failure.
3636
/// eventually:the function that will be called regardless of success or failure.
3737
Future apiGet(String path,
3838
{Map<String, String> header,
@@ -47,7 +47,7 @@ Future apiGet(String path,
4747
///
4848
/// data: the data to post, it will be marshaled to json automatically.
4949
/// ok: the function that will be called on success.
50-
/// fail:the fuction that will be called on failure.
50+
/// fail:the function that will be called on failure.
5151
/// eventually:the function that will be called regardless of success or failure.
5252
Future apiPost(String path, dynamic data,
5353
{Map<String, String> header,

tools/goctl/api/parser/g4/ast/service.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,15 @@ func (v *ApiVisitor) VisitReplybody(ctx *api.ReplybodyContext) any {
268268
v.panic(lit.Expr(), fmt.Sprintf("expecting 'ID', but found golang keyword '%s'", lit.Expr().Text()))
269269
}
270270
default:
271-
v.panic(dt.Expr(), fmt.Sprintf("unsupport %s", dt.Expr().Text()))
271+
v.panic(dt.Expr(), fmt.Sprintf("unsupported %s", dt.Expr().Text()))
272272
}
273273
case *Literal:
274274
lit := dataType.Literal.Text()
275275
if api.IsGolangKeyWord(lit) {
276276
v.panic(dataType.Literal, fmt.Sprintf("expecting 'ID', but found golang keyword '%s'", lit))
277277
}
278278
default:
279-
v.panic(dt.Expr(), fmt.Sprintf("unsupport %s", dt.Expr().Text()))
279+
v.panic(dt.Expr(), fmt.Sprintf("unsupported %s", dt.Expr().Text()))
280280
}
281281

282282
return &Body{

tools/goctl/api/parser/g4/ast/type.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func (v *ApiVisitor) VisitTypeBlockStruct(ctx *api.TypeBlockStructContext) any {
190190
structExpr := v.newExprWithToken(ctx.GetStructToken())
191191
structTokenText := ctx.GetStructToken().GetText()
192192
if structTokenText != "struct" {
193-
v.panic(structExpr, fmt.Sprintf("expecting 'struct', found imput '%s'", structTokenText))
193+
v.panic(structExpr, fmt.Sprintf("expecting 'struct', found input '%s'", structTokenText))
194194
}
195195

196196
if api.IsGolangKeyWord(structTokenText, "struct") {

tools/goctl/api/parser/parser.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type parser struct {
1818
}
1919

2020
// Parse parses the api file.
21-
// Depreacted: use tools/goctl/pkg/parser/api/parser/parser.go:18 instead,
21+
// Deprecated: use tools/goctl/pkg/parser/api/parser/parser.go:18 instead,
2222
// it will be removed in the future.
2323
func Parse(filename string) (*spec.ApiSpec, error) {
2424
if env.UseExperimental() {
@@ -63,14 +63,14 @@ func parseContent(content string, skipCheckTypeDeclaration bool, filename ...str
6363
return apiSpec, nil
6464
}
6565

66-
// Depreacted: use tools/goctl/pkg/parser/api/parser/parser.go:18 instead,
66+
// Deprecated: use tools/goctl/pkg/parser/api/parser/parser.go:18 instead,
6767
// it will be removed in the future.
6868
// ParseContent parses the api content
6969
func ParseContent(content string, filename ...string) (*spec.ApiSpec, error) {
7070
return parseContent(content, false, filename...)
7171
}
7272

73-
// Depreacted: use tools/goctl/pkg/parser/api/parser/parser.go:18 instead,
73+
// Deprecated: use tools/goctl/pkg/parser/api/parser/parser.go:18 instead,
7474
// it will be removed in the future.
7575
// ParseContentWithParserSkipCheckTypeDeclaration parses the api content with skip check type declaration
7676
func ParseContentWithParserSkipCheckTypeDeclaration(content string, filename ...string) (*spec.ApiSpec, error) {
@@ -227,7 +227,7 @@ func (p parser) astTypeToSpec(in ast.DataType) spec.Type {
227227
return spec.PointerType{RawName: v.PointerExpr.Text(), Type: spec.DefineStruct{RawName: raw}}
228228
}
229229

230-
panic(fmt.Sprintf("unspported type %+v", in))
230+
panic(fmt.Sprintf("unsupported type %+v", in))
231231
}
232232

233233
func (p parser) stringExprs(docs []ast.Expr) []string {

tools/goctl/model/sql/test/sqlconn.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ func (conn *MockConn) RawDB() (*sql.DB, error) {
9999
return conn.db, nil
100100
}
101101

102-
// Transact is the implemention of sqlx.SqlConn, nothing to do
102+
// Transact is the implementation of sqlx.SqlConn, nothing to do
103103
func (conn *MockConn) Transact(func(session sqlx.Session) error) error {
104104
return nil
105105
}
106106

107-
// TransactCtx is the implemention of sqlx.SqlConn, nothing to do
107+
// TransactCtx is the implementation of sqlx.SqlConn, nothing to do
108108
func (conn *MockConn) TransactCtx(ctx context.Context, fn func(context.Context, sqlx.Session) error) error {
109109
return nil
110110
}

0 commit comments

Comments
 (0)