Learn Go Programming from Scratch - Part 07 - Switch

Опубликовано: 30 Май 2026
на канале: ChamiViews
39
4

In this Go (Golang) programming tutorial, we dive into the powerful `switch` statement and type assertions. You'll learn how to use the `switch` statement to make decisions based on values, weekdays, and even time conditions. We'll also explore type assertions to determine the data type of interface variables.

Topics covered in this tutorial:
Using `switch` to make decisions based on values.
Switching on weekdays and time conditions.
Creating a dynamic `switch` without an expression.
Type assertion to determine the data type of interface variables.

By the end of this video, you'll have a solid understanding of how to leverage Go's `switch` statement and type assertions for more effective decision-making in your Go programs.

0:00 - Introduction
0:52 - Exploring the `switch` Statement
Using `switch` for Value Matching
Switching on Weekdays
Dynamic `switch` without Expression
10:39 - Understanding Type Assertions
Checking for Bool and Int Types
Handling Unknown Types
Note: If you want to print the type of t, use this code line fmt.Printf("Don't know type %T\n", t)
15:55 - Conclusion

Welcome to ChamiViews - Your Gateway to the World of Programming and Technology!

🚀 About ChamiViews:
ChamiViews is your one-stop destination for a diverse range of programming languages and technology tutorials. Whether you're a beginner starting your coding journey or an experienced developer looking to sharpen your skills, this channel is tailored for you. We're passionate about sharing our knowledge and expertise in various programming languages, including Python, PHP, Java, C, Angular, Go, and more.

🔔 Subscribe to ChamiViews:
Don't forget to hit the subscribe button and ring the notification bell to stay updated with our latest programming tutorials and tech content. Whether you're a student, professional, or tech enthusiast, there's something here for everyone.

🌐 Connect with ChamiViews:
Website: [https://chamiviews.blogspot.com/]
Twitter: [  / chamodlakmal97  ]
Facebook: [  / chamodlakmal97  ]
Instagram: [  / chamod.lakmal  ]

📺 Explore Our Playlists:
Python Series:    • Python Sinhala By ChamiViews Part 1 - Intr...  

Angular 8:   • Angular Sinhala By ChamiViews Part 1 - Int...  

Android :   • Android Sinhala By ChamiViews Part 1 - Int...  

PHP Series:    • Php Sinhala By ChamiViews Part 1 - Xampp I...  

PHP + Mysql Series:    • Php + Mysql Sinhala By ChamiViews Part 1 -...  

Bootstrap Series :    • Bootstrap Sinhala By ChamiViews Part 1  

Scala Series :    • Scala Sinhala By ChamiViews Part 1 - Intro...  

C Language Series:    • C Language Sinhala By ChamiViews Part 1 - ...  

JAVA Series:    • Java Sinhala By ChamiViews Part 1 - Intro  

C++ Series :    • C++  Sinhala By ChamiViews Part 1  

OOP Series With JAVA:    • Java Sinhala By ChamiViews Part 34 - Worki...  

R Series:   • Statistical Methods using R By ChamiViews ...  

Subscribe for more Go (Golang) programming tutorials and stay updated with the latest programming tips and tricks!

#Golang #Programming #GoTutorial #SwitchStatements #TypeAssertions #chamiviews
Go Programming, Golang Tutorial, Switch Statements, Type Assertions, Go Programming Basics, Programming Tips, Go Language, Code Tutorial, Go Development, Programming for Beginners, Learn Golang