Post

GoLangGoLang

J
James ROBERT

Posted on 26th April 2024|19 views

0
votes

Type Switch Golang

Explain about Type Switch Statement in Go?

Answers
P
jordan chris

Posted on 26th April 2024

Type Switch is a build that allows different type assertions in sequence. Type switch is identical to the normal switch statement, but type switch specifies types.

Syntax:

Switch b:= c. (type)
{
Case A; // here b has type A
Case C; // here b has type C
default;
 }


 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo
  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos