Golang: Giải thích Interface Cuối cùng Bạn Cần

Tác giả: Flo Woelki
Ngày xuất bản: 2024-06-07T00:00:00
Length: 17:58

Tóm tắt nội dung

Mô tả

Interfaces are common, easy and important to use in Golang. Next to interfaces, structs are also really important. I've also made a video about them, so feel free to check out this video as well: https://youtu.be/c8H0w4yBL10

📝 Description

This time we're tackling interfaces, a vital component of Go and a must-have in every Go developer's toolkit. We'll start off with the basics of defining and implementing interfaces and move on to more advanced topics like implicit interface implementation, the empty interface, and type assertions. We'll also explore the practical application of interfaces through a use case involving a Shape interface with an `Area()` method. This will provide a clear demonstration of methods attached to structs.

⏳ Timestamps:

00:00 - Definition of defer

00:35 - Why interfaces are important

01:42 - Practical example of interfaces

08:38 - The interface type

11:33 - Interface composition

14:29 - Errors and interfaces

17:22 - Outro

👋 Hey there!

If you are new to this channel: Hey 👋 my name is Flo and I am a professional software engineer with a passion for coding in Golang, TypeScript, JavaScript, and Rust. This channel is where I share that passion and dive into the exciting world of software engineering. Plus, I love using Emojis and paper-based animations (so have a look for that, if you want to find my videos).

📨 Support and Connect!

Buy me a coffee: https://www.buymeacoffee.com/florianwoelki

Become a member: https://www.youtube.com/@FloWoelki/membership

Discord: https://discord.gg/TnA7drJ

Instagram: https://www.instagram.com/flowydev/

LinkedIn: https://www.linkedin.com/in/florian-woelki/

TikTok: https://www.tiktok.com/@florianwoelki

GitHub: https://github.com/FlorianWoelki

📝 Copyright Notice

The original Go Gopher version is originally designed by Renée French (Source: https://go.dev/blog/gopher License details: https://creativecommons.org/licenses/by/4.0/). The gopher used in the video and thumbnail is inspired by this author.

#golang #go #interface

Dịch Vào Lúc: 2025-08-05T13:23:41Z

Yêu cầu dịch (Một bản dịch khoảng 5 phút)

Phiên bản 3 (ổn định)

Tối ưu hóa cho một người nói. Phù hợp cho video chia sẻ kiến thức hoặc giảng dạy.

Video Đề Xuất