Go

JSON Encoding

json.Marshal, json.Unmarshal, struct tags, custom marshaling, streaming, RawMessage

20 āļ„āļģāļ–āļēāļĄāļŠāļąāļĄāļ āļēāļĐāļ“āđŒÂ·
Mid-Level
1

Which function allows encoding a Go struct into JSON?

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

json.Marshal encodes a Go struct into JSON bytes. This function reads struct tags to customize serialization (renaming, field omission). For streaming to io.Writer, using json.NewEncoder avoids creating an intermediate buffer in memory.

2

Which function allows decoding JSON into a Go struct?

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

json.Unmarshal decodes JSON bytes into a Go struct. A pointer to the target struct must be passed for data to be correctly written. For streaming from io.Reader, json.NewDecoder is more efficient as it avoids loading all JSON into memory.

3

Which JSON struct tag allows renaming a field during serialization?

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

The json:"custom_name" tag allows renaming a field during JSON serialization. For example, a UserID field can become user_id in JSON. This is useful for respecting naming conventions (snake_case in JSON vs CamelCase in Go).

4

Which JSON struct tag completely excludes a field from serialization?

5

Which JSON struct tag allows omitting a field if its value is empty?

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

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

Go Basics

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

Go Data Structures

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

Go Interfaces

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

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 āļ„āļģāļ–āļēāļĄ

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 āđāļĨāļ°āļ•āļąāļ§āļˆāļģāļĨāļ­āļ‡āļŠāļąāļĄāļ āļēāļĐāļ“āđŒ

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