Special offers now — see discounted courses.
day
:
hour
:
min
:
sec
See special offers
Deep Dive Into Go Lang Interfaces

Deep Dive Into Go Lang Interfaces

55mAdvanced2024-05-13

Authors

Miki Tebeka

Miki Tebeka

CEO at 353Solutions

Course details

Go has a unique approach to some of the methods used in object-oriented programming–particularly with interfaces. In this course, learn how to design and use interfaces in Go. Instructor Miki Tebeka takes a look at various important interfaces in the standard library and examines how interfaces are implemented and the cost of using them. Learn about design decisions behind interfaces and how you can design your own interfaces to be smaller and more performant. And finally, get a look at empty interfaces—including why they’re needed and how you can work with them.

Skills covered

Programming LanguagesSoftware DevelopmentDeep Dive (X:Y)

Concepts

0. Introduction

  • 01 - Go interfaces
  • 02 - What you should know
  • 03 - Getting started with Codespaces

1. Interfaces in Go

  • 04 - When should you use interfaces
  • 05 - How interfaces are implemented
  • 06 - The cost of using interfaces

2. Interface Design

  • 07 - Say what you need, not what you provide
  • 08 - Case study - Analyzing sort.Interface
  • 09 - Embedding interfaces
  • 10 - Using type assertion to keep the interface small
  • 11 - Design for performance
  • 12 - Challenge - Interface design
  • 13 - Solution - Interface design

3. I O-Related Interfaces

  • 14 - The io.Reader and io.Writer interfaces
  • 15 - Composing readers and writers
  • 16 - In-memory readers and writers
  • 17 - Implementing io.Reader and io.Writer
  • 18 - Challenge - Counting lines in a compressed file
  • 19 - Solution - Counting lines in a compressed file

4. Interfaces That Change Behavior

  • 20 - String representation with fmt.Stringer
  • 21 - Using fmt.Formatter to support print flags
  • 22 - Custom JSON serialization with json.Marshaler and json.Unmarshaler
  • 23 - Challenge - Custom error
  • 24 - Solution - Custom error

5. The Empty Interface

  • 25 - What is the empty interface
  • 26 - Using reflection with the empty interface
  • 27 - Using generics to avoid the empty interface
  • 28 - Challenge - Wrapping sync.Pool
  • 29 - Solution - Wrapping sync.Pool

Conclusion

  • 30 - Next steps

Related courses

Related learn paths

About us

LyndaKade is a leading learning platform that helps people learn business, software, technology, and creative skills to achieve personal and professional goals.

Phone numberAparat ChannelTelegram SupportTelegram ChannelInstagram Page

All rights to this site belong to LyndaKade.

Terms of Service|Privacy Policy

نماد الکترونیک enamad در صورت اتصال با آی‌پی داخل کشور، نمایش داده خواهد شد.
logo-samandehi - لوگو ساماندهی
zarinpal
zibal