بازگشت به نتایج جستجو

samber / AGENT SKILL

golang-structs-interfaces

فارسی + English

این اسکیل چه می‌کند؟

طراحی struct/interface در Go؛ composition، embedding، assertion/switch نوع، interface segregation، DI از interface، field tag و pointer/value receiver.

ORIGINAL DESCRIPTION

Golang struct and interface design patterns — composition, embedding, type assertions, type switches, interface segregation, dependency injection via interfaces, struct field tags, and pointer vs value receivers.

چه زمانی به کار می‌آید؟

برای طراحی type/interface، embedding، assertion/switch، JSON/YAML/DB tag یا انتخاب receiver؛ همچنین وقتی کاربر

WHEN TO USE

when designing Go types, defining or implementing interfaces, embedding structs or interfaces, writing type assertions or type switches, adding struct field tags for JSON/YAML/DB serialization, or choosing between pointer and value receivers. Also use when the user

کاربردهای مرتبط

برچسب‌گذاری خودکار بر اساس نام و توضیح؛ ممکن است نیازمند اصلاح باشد.