Posted on 25th July 2024|19 views
Explain about Type Switch Statement in Go?
Posted on 25th July 2024| views
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;
}