Go

Go Interfaces

Interfaces, type assertions, type switches, empty interface, error interface

18 āļ„āļģāļ–āļēāļĄāļŠāļąāļĄāļ āļēāļĐāļ“āđŒÂ·
Junior
1

What is an interface in Go?

āļ„āļģāļ•āļ­āļš

An interface in Go is a type that defines a set of method signatures. A type implements an interface implicitly by defining all its methods, without explicit declaration. This enables strong decoupling and flexibility in Go program design.

2

How does a type implement an interface in Go?

āļ„āļģāļ•āļ­āļš

In Go, interface implementation is implicit: a type just needs to define all the methods of the interface. No explicit declaration (like 'implements' in Java) is needed. This allows adding interfaces to existing types without modifying their source code.

3

What is special about the empty interface (interface{}) in Go?

āļ„āļģāļ•āļ­āļš

The empty interface (interface{}) defines no methods, which means all types automatically implement it. It can therefore hold a value of any type. Since Go 1.18, it is aliased by the predeclared type 'any' for better clarity.

4

Since Go 1.18, what is the alias for the interface{} type?

5

What is the syntax for a type assertion in Go?

+15 āļ„āļģāļ–āļēāļĄāļŠāļąāļĄāļ āļēāļĐāļ“āđŒ

āļŦāļąāļ§āļ‚āđ‰āļ­āļŠāļąāļĄāļ āļēāļĐāļ“āđŒ Go āļ­āļ·āđˆāļ™āđ†

Go Basics

Junior
25 āļ„āļģāļ–āļēāļĄ

Go Data Structures

Junior
20 āļ„āļģāļ–āļēāļĄ

Error Handling

Junior
20 āļ„āļģāļ–āļēāļĄ

Goroutines Basics

Junior
20 āļ„āļģāļ–āļēāļĄ

Channels

Junior
22 āļ„āļģāļ–āļēāļĄ

Go Modules

Mid-Level
18 āļ„āļģāļ–āļēāļĄ

HTTP Server

Mid-Level
24 āļ„āļģāļ–āļēāļĄ

HTTP Client

Mid-Level
18 āļ„āļģāļ–āļēāļĄ

JSON Encoding

Mid-Level
20 āļ„āļģāļ–āļēāļĄ

database/sql

Mid-Level
22 āļ„āļģāļ–āļēāļĄ

Context Package

Mid-Level
20 āļ„āļģāļ–āļēāļĄ

Testing

Mid-Level
22 āļ„āļģāļ–āļēāļĄ

Concurrency Patterns

Mid-Level
24 āļ„āļģāļ–āļēāļĄ

Sync Primitives

Mid-Level
22 āļ„āļģāļ–āļēāļĄ

Go Web Frameworks

Mid-Level
20 āļ„āļģāļ–āļēāļĄ

REST API Design

Mid-Level
20 āļ„āļģāļ–āļēāļĄ

gRPC

Mid-Level
22 āļ„āļģāļ–āļēāļĄ

Reflection

Senior
20 āļ„āļģāļ–āļēāļĄ

Memory Management

Senior
24 āļ„āļģāļ–āļēāļĄ

Performance Optimization

Senior
22 āļ„āļģāļ–āļēāļĄ

Generics

Senior
20 āļ„āļģāļ–āļēāļĄ

Go Design Patterns

Senior
24 āļ„āļģāļ–āļēāļĄ

Microservices

Senior
24 āļ„āļģāļ–āļēāļĄ

Security & Authentication

Senior
24 āļ„āļģāļ–āļēāļĄ

Docker & Containerization

Senior
20 āļ„āļģāļ–āļēāļĄ

Kubernetes Basics

Senior
22 āļ„āļģāļ–āļēāļĄ

Advanced Go

Senior
20 āļ„āļģāļ–āļēāļĄ

CLI Development

Senior
20 āļ„āļģāļ–āļēāļĄ

āđ€āļŠāļĩāđˆāļĒāļ§āļŠāļēāļ Go āļŠāļģāļŦāļĢāļąāļšāļāļēāļĢāļŠāļąāļĄāļ āļēāļĐāļ“āđŒāļ„āļĢāļąāđ‰āļ‡āļ–āļąāļ”āđ„āļ›

āđ€āļ‚āđ‰āļēāļ–āļķāļ‡āļ„āļģāļ–āļēāļĄāļ—āļąāđ‰āļ‡āļŦāļĄāļ” flashcards āđāļšāļšāļ—āļ”āļŠāļ­āļšāđ€āļ—āļ„āļ™āļīāļ„ āđāļšāļšāļāļķāļāļŦāļąāļ” code review āđāļĨāļ°āļ•āļąāļ§āļˆāļģāļĨāļ­āļ‡āļŠāļąāļĄāļ āļēāļĐāļ“āđŒ

āđ€āļĢāļīāđˆāļĄāđƒāļŠāđ‰āļŸāļĢāļĩ