@@ -76,7 +76,7 @@ func main() {
7676 Timeout : 10 * time .Second ,
7777 }
7878
79- params := map [string ]interface {} {
79+ params := map [string ]any {
8080 "method" : "GET" ,
8181 "headers" : map [string ]string {
8282 "Accept" : "application/json" ,
@@ -101,12 +101,12 @@ func main() {
101101 Timeout : 15 * time .Second ,
102102 }
103103
104- postParams := map [string ]interface {} {
104+ postParams := map [string ]any {
105105 "method" : "POST" ,
106106 "headers" : map [string ]string {
107107 "Content-Type" : "application/json" ,
108108 },
109- "body" : map [string ]interface {} {
109+ "body" : map [string ]any {
110110 "name" : "John Doe" ,
111111 "email" : "john@example.com" ,
112112 "message" : "Hello from API caller!" ,
@@ -118,7 +118,7 @@ func main() {
118118 log .Printf ("REST POST Error: %v\n " , err )
119119 } else {
120120 fmt .Printf ("Status: %d\n " , postResult ["statusCode" ])
121- if body , ok := postResult ["body" ].(map [string ]interface {} ); ok {
121+ if body , ok := postResult ["body" ].(map [string ]any ); ok {
122122 if json , ok := body ["json" ]; ok {
123123 fmt .Printf ("Echoed JSON: %v\n " , json )
124124 }
@@ -170,31 +170,31 @@ func main() {
170170 wsdl string
171171 method string
172172 action string
173- params map [string ]interface {}
173+ params map [string ]any
174174 }{
175175 {
176176 name : "W3Schools Temperature Converter" ,
177177 url : "https://www.w3schools.com/xml/tempconvert.asmx" ,
178178 wsdl : "https://www.w3schools.com/xml/tempconvert.asmx?WSDL" ,
179179 method : "CelsiusToFahrenheit" ,
180180 action : "https://www.w3schools.com/xml/CelsiusToFahrenheit" ,
181- params : map [string ]interface {} {"Celsius" : "100" },
181+ params : map [string ]any {"Celsius" : "100" },
182182 },
183183 {
184184 name : "DNEOnline Calculator" ,
185185 url : "http://www.dneonline.com/calculator.asmx" ,
186186 wsdl : "http://www.dneonline.com/calculator.asmx?WSDL" ,
187187 method : "Add" ,
188188 action : "http://tempuri.org/Add" ,
189- params : map [string ]interface {} {"intA" : "25" , "intB" : "17" },
189+ params : map [string ]any {"intA" : "25" , "intB" : "17" },
190190 },
191191 {
192192 name : "Thomas Bayer Blz Service" ,
193193 url : "http://www.thomas-bayer.com/axis2/services/BLZService" ,
194194 wsdl : "http://www.thomas-bayer.com/axis2/services/BLZService?wsdl" ,
195195 method : "getBank" ,
196196 action : "" ,
197- params : map [string ]interface {} {"blz" : "66050000" },
197+ params : map [string ]any {"blz" : "66050000" },
198198 },
199199 }
200200
@@ -210,7 +210,7 @@ func main() {
210210 WSDLUrl : soapTest .wsdl ,
211211 }
212212
213- soapParams := map [string ]interface {} {
213+ soapParams := map [string ]any {
214214 "method" : soapTest .method ,
215215 "soapAction" : soapTest .action ,
216216 "body" : soapTest .params ,
@@ -223,7 +223,7 @@ func main() {
223223 fmt .Printf ("✓ SOAP call succeeded!\n " )
224224 fmt .Printf ("Status: %d\n " , statusCode )
225225
226- if body , ok := soapResult ["body" ].(map [string ]interface {} ); ok {
226+ if body , ok := soapResult ["body" ].(map [string ]any ); ok {
227227 fmt .Printf ("Parsed SOAP Response (key-value pairs):\n " )
228228 for key , value := range body {
229229 fmt .Printf (" %s: %v\n " , key , value )
@@ -260,8 +260,8 @@ func main() {
260260 }
261261
262262 // Simple parameter map - automatically converted to protobuf
263- grpcParams := map [string ]interface {} {
264- "body" : map [string ]interface {} {
263+ grpcParams := map [string ]any {
264+ "body" : map [string ]any {
265265 "user_id" : "12345" ,
266266 },
267267 }
@@ -273,7 +273,7 @@ func main() {
273273 } else {
274274 fmt .Printf ("Status: %d\n " , grpcResult ["statusCode" ])
275275 // Body is automatically parsed from protobuf to map!
276- if body , ok := grpcResult ["body" ].(map [string ]interface {} ); ok {
276+ if body , ok := grpcResult ["body" ].(map [string ]any ); ok {
277277 fmt .Printf ("Parsed gRPC Response:\n " )
278278 for key , value := range body {
279279 fmt .Printf (" %s: %v\n " , key , value )
@@ -292,7 +292,7 @@ func main() {
292292 MaxRetries : 2 , // Retry up to 2 times on timeout
293293 }
294294
295- retryParams := map [string ]interface {} {
295+ retryParams := map [string ]any {
296296 "method" : "GET" ,
297297 "headers" : map [string ]string {
298298 "Accept" : "application/json" ,
@@ -363,43 +363,43 @@ func registerTestService(server *grpc.Server) error {
363363 // Create a simple service descriptor programmatically
364364 // This creates a UserService with a GetUser method
365365 fileDesc := & descriptorpb.FileDescriptorProto {
366- Name : proto . String ("user.proto" ),
367- Package : proto . String ("user" ),
366+ Name : new ("user.proto "),
367+ Package : new ("user "),
368368 MessageType : []* descriptorpb.DescriptorProto {
369369 {
370- Name : proto . String ("GetUserRequest" ),
370+ Name : new ("GetUserRequest "),
371371 Field : []* descriptorpb.FieldDescriptorProto {
372372 {
373- Name : proto . String ("user_id" ),
373+ Name : new ("user_id "),
374374 Number : proto .Int32 (1 ),
375375 Type : descriptorpb .FieldDescriptorProto_TYPE_STRING .Enum (),
376376 Label : descriptorpb .FieldDescriptorProto_LABEL_OPTIONAL .Enum (),
377377 },
378378 },
379379 },
380380 {
381- Name : proto . String ("GetUserResponse" ),
381+ Name : new ("GetUserResponse "),
382382 Field : []* descriptorpb.FieldDescriptorProto {
383383 {
384- Name : proto . String ("user_id" ),
384+ Name : new ("user_id "),
385385 Number : proto .Int32 (1 ),
386386 Type : descriptorpb .FieldDescriptorProto_TYPE_STRING .Enum (),
387387 Label : descriptorpb .FieldDescriptorProto_LABEL_OPTIONAL .Enum (),
388388 },
389389 {
390- Name : proto . String ("name" ),
390+ Name : new ("name "),
391391 Number : proto .Int32 (2 ),
392392 Type : descriptorpb .FieldDescriptorProto_TYPE_STRING .Enum (),
393393 Label : descriptorpb .FieldDescriptorProto_LABEL_OPTIONAL .Enum (),
394394 },
395395 {
396- Name : proto . String ("email" ),
396+ Name : new ("email "),
397397 Number : proto .Int32 (3 ),
398398 Type : descriptorpb .FieldDescriptorProto_TYPE_STRING .Enum (),
399399 Label : descriptorpb .FieldDescriptorProto_LABEL_OPTIONAL .Enum (),
400400 },
401401 {
402- Name : proto . String ("message" ),
402+ Name : new ("message "),
403403 Number : proto .Int32 (4 ),
404404 Type : descriptorpb .FieldDescriptorProto_TYPE_STRING .Enum (),
405405 Label : descriptorpb .FieldDescriptorProto_LABEL_OPTIONAL .Enum (),
@@ -409,12 +409,12 @@ func registerTestService(server *grpc.Server) error {
409409 },
410410 Service : []* descriptorpb.ServiceDescriptorProto {
411411 {
412- Name : proto . String ("UserService" ),
412+ Name : new ("UserService "),
413413 Method : []* descriptorpb.MethodDescriptorProto {
414414 {
415- Name : proto . String ("GetUser" ),
416- InputType : proto . String (".user.GetUserRequest" ),
417- OutputType : proto . String (".user.GetUserResponse" ),
415+ Name : new ("GetUser "),
416+ InputType : new (".user .GetUserRequest "),
417+ OutputType : new (".user .GetUserResponse "),
418418 },
419419 },
420420 },
@@ -449,7 +449,7 @@ func registerTestService(server *grpc.Server) error {
449449 methodDesc := methods .Get (0 )
450450
451451 // Create a handler for the method
452- handler := func (srv interface {} , ctx context.Context , dec func (interface {} ) error , interceptor grpc.UnaryServerInterceptor ) (interface {} , error ) {
452+ handler := func (srv any , ctx context.Context , dec func (any ) error , interceptor grpc.UnaryServerInterceptor ) (any , error ) {
453453 // Create a dynamic request message
454454 reqMsg := dynamicpb .NewMessage (methodDesc .Input ())
455455 if err := dec (reqMsg ); err != nil {
@@ -479,7 +479,7 @@ func registerTestService(server *grpc.Server) error {
479479 // Register the service and handler
480480 serviceInfo := & grpc.ServiceDesc {
481481 ServiceName : string (serviceDesc .FullName ()),
482- HandlerType : (* interface {} )(nil ),
482+ HandlerType : (* any )(nil ),
483483 Methods : []grpc.MethodDesc {
484484 {
485485 MethodName : string (methodDesc .Name ()),
0 commit comments