chore: change interface{} to any (#2818)
* chore: change interface{} to any
* chore: update goctl version to 1.5.0
* chore: update goctl deps
This commit is contained in:
@@ -15,7 +15,7 @@ var testApi string
|
||||
var parser = ast.NewParser(ast.WithParserPrefix("test.api"), ast.WithParserDebug())
|
||||
|
||||
func TestApi(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.Api().Accept(visitor)
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ func TestApi(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestApiSyntax(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.Api().Accept(visitor)
|
||||
}
|
||||
parser.Accept(fn, `
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/zeromicro/go-zero/tools/goctl/api/parser/g4/gen/api"
|
||||
)
|
||||
|
||||
var importAccept = func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
var importAccept = func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.ImportSpec().Accept(visitor)
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/zeromicro/go-zero/tools/goctl/api/parser/g4/gen/api"
|
||||
)
|
||||
|
||||
var infoAccept = func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
var infoAccept = func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.InfoSpec().Accept(visitor)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func TestBody(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) any {
|
||||
return p.Body().Accept(v)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -33,7 +33,7 @@ func TestBody(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestRoute(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) any {
|
||||
return p.Route().Accept(v)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -196,7 +196,7 @@ func TestRoute(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAtHandler(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) any {
|
||||
return p.AtHandler().Accept(v)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -236,7 +236,7 @@ func TestAtHandler(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAtDoc(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) any {
|
||||
return p.AtDoc().Accept(v)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -308,7 +308,7 @@ func TestAtDoc(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestServiceRoute(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) any {
|
||||
return p.ServiceRoute().Accept(v)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -370,7 +370,7 @@ func TestServiceRoute(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestServiceApi(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) any {
|
||||
return p.ServiceApi().Accept(v)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -452,7 +452,7 @@ func TestServiceApi(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAtServer(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) any {
|
||||
return p.AtServer().Accept(v)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -520,7 +520,7 @@ func TestAtServer(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestServiceSpec(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, v *ast.ApiVisitor) any {
|
||||
return p.ServiceSpec().Accept(v)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/zeromicro/go-zero/tools/goctl/api/parser/g4/gen/api"
|
||||
)
|
||||
|
||||
var syntaxAccept = func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
var syntaxAccept = func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.SyntaxLit().Accept(visitor)
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/zeromicro/go-zero/tools/goctl/api/parser/g4/gen/api"
|
||||
)
|
||||
|
||||
var fieldAccept = func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
var fieldAccept = func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.Field().Accept(visitor)
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ func TestField(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDataType_ID(t *testing.T) {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.DataType().Accept(visitor)
|
||||
}
|
||||
t.Run("Struct", func(t *testing.T) {
|
||||
@@ -117,7 +117,7 @@ func TestDataType_ID(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDataType_Map(t *testing.T) {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.MapType().Accept(visitor)
|
||||
}
|
||||
t.Run("basicKey", func(t *testing.T) {
|
||||
@@ -147,7 +147,7 @@ func TestDataType_Map(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDataType_Array(t *testing.T) {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.ArrayType().Accept(visitor)
|
||||
}
|
||||
t.Run("basic", func(t *testing.T) {
|
||||
@@ -200,7 +200,7 @@ func TestDataType_Array(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDataType_Interface(t *testing.T) {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.DataType().Accept(visitor)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -222,7 +222,7 @@ func TestDataType_Interface(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDataType_Time(t *testing.T) {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.DataType().Accept(visitor)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -232,7 +232,7 @@ func TestDataType_Time(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDataType_Pointer(t *testing.T) {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
dt := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.PointerType().Accept(visitor)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -252,7 +252,7 @@ func TestDataType_Pointer(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestAlias(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.TypeAlias().Accept(visitor)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -281,7 +281,7 @@ func TestAlias(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTypeStruct(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.TypeStruct().Accept(visitor)
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ func TestTypeStruct(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTypeBlock(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.TypeBlock().Accept(visitor)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -366,7 +366,7 @@ func TestTypeBlock(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTypeLit(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.TypeLit().Accept(visitor)
|
||||
}
|
||||
t.Run("normal", func(t *testing.T) {
|
||||
@@ -435,7 +435,7 @@ func TestTypeLit(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTypeUnExported(t *testing.T) {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) interface{} {
|
||||
fn := func(p *api.ApiParserParser, visitor *ast.ApiVisitor) any {
|
||||
return p.TypeSpec().Accept(visitor)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user