Fix typos in comments and messages (#5254)

This commit is contained in:
Gregor Fischer
2025-10-25 03:28:40 +02:00
committed by GitHub
parent e9c3607bc6
commit 942cdae41d
5 changed files with 11 additions and 11 deletions

View File

@@ -32,7 +32,7 @@ import '../vars/vars.dart';
/// Send GET request. /// Send GET request.
/// ///
/// ok: the function that will be called on success. /// ok: the function that will be called on success.
/// failthe fuction that will be called on failure. /// failthe function that will be called on failure.
/// eventuallythe function that will be called regardless of success or failure. /// eventuallythe function that will be called regardless of success or failure.
Future apiGet(String path, Future apiGet(String path,
{Map<String, String> header, {Map<String, String> header,
@@ -47,7 +47,7 @@ Future apiGet(String path,
/// ///
/// data: the data to post, it will be marshaled to json automatically. /// data: the data to post, it will be marshaled to json automatically.
/// ok: the function that will be called on success. /// ok: the function that will be called on success.
/// failthe fuction that will be called on failure. /// failthe function that will be called on failure.
/// eventuallythe function that will be called regardless of success or failure. /// eventuallythe function that will be called regardless of success or failure.
Future apiPost(String path, dynamic data, Future apiPost(String path, dynamic data,
{Map<String, String> header, {Map<String, String> header,

View File

@@ -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())) v.panic(lit.Expr(), fmt.Sprintf("expecting 'ID', but found golang keyword '%s'", lit.Expr().Text()))
} }
default: 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: case *Literal:
lit := dataType.Literal.Text() 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)) v.panic(dataType.Literal, fmt.Sprintf("expecting 'ID', but found golang keyword '%s'", lit))
} }
default: 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{ return &Body{

View File

@@ -190,7 +190,7 @@ func (v *ApiVisitor) VisitTypeBlockStruct(ctx *api.TypeBlockStructContext) any {
structExpr := v.newExprWithToken(ctx.GetStructToken()) structExpr := v.newExprWithToken(ctx.GetStructToken())
structTokenText := ctx.GetStructToken().GetText() structTokenText := ctx.GetStructToken().GetText()
if structTokenText != "struct" { 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") { if api.IsGolangKeyWord(structTokenText, "struct") {

View File

@@ -18,7 +18,7 @@ type parser struct {
} }
// Parse parses the api file. // 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. // it will be removed in the future.
func Parse(filename string) (*spec.ApiSpec, error) { func Parse(filename string) (*spec.ApiSpec, error) {
if env.UseExperimental() { if env.UseExperimental() {
@@ -63,14 +63,14 @@ func parseContent(content string, skipCheckTypeDeclaration bool, filename ...str
return apiSpec, nil 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. // it will be removed in the future.
// ParseContent parses the api content // ParseContent parses the api content
func ParseContent(content string, filename ...string) (*spec.ApiSpec, error) { func ParseContent(content string, filename ...string) (*spec.ApiSpec, error) {
return parseContent(content, false, filename...) 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. // it will be removed in the future.
// ParseContentWithParserSkipCheckTypeDeclaration parses the api content with skip check type declaration // ParseContentWithParserSkipCheckTypeDeclaration parses the api content with skip check type declaration
func ParseContentWithParserSkipCheckTypeDeclaration(content string, filename ...string) (*spec.ApiSpec, error) { 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}} 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 { func (p parser) stringExprs(docs []ast.Expr) []string {

View File

@@ -99,12 +99,12 @@ func (conn *MockConn) RawDB() (*sql.DB, error) {
return conn.db, nil 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 { func (conn *MockConn) Transact(func(session sqlx.Session) error) error {
return nil 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 { func (conn *MockConn) TransactCtx(ctx context.Context, fn func(context.Context, sqlx.Session) error) error {
return nil return nil
} }