<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title>Interfaces - แท็ก - Kawin&#39;s Pages</title>
        <link>https://kawin.dev/tags/interfaces/</link>
        <description>Interfaces - แท็ก - Kawin&#39;s Pages</description>
        <generator>Hugo -- gohugo.io</generator><language>th</language><managingEditor>kawin.v@kkumail.com (Kawin Viriyaprasopsook)</managingEditor>
            <webMaster>kawin.v@kkumail.com (Kawin Viriyaprasopsook)</webMaster><lastBuildDate>Sat, 08 Nov 2025 12:00:00 &#43;0700</lastBuildDate><atom:link href="https://kawin.dev/tags/interfaces/" rel="self" type="application/rss+xml" /><item>
    <title>รับ interface แล้วคืนค่า struct</title>
    <link>https://kawin.dev/posts/go/accept_interfaces_return_structs/</link>
    <pubDate>Sat, 08 Nov 2025 12:00:00 &#43;0700</pubDate>
    <author>kawin.v@kkumail.com (Kawin Viriyaprasopsook)</author>
    <guid>https://kawin.dev/posts/go/accept_interfaces_return_structs/</guid>
    <description><![CDATA[<div class="featured-image">
                <img src="/featured-image.png" referrerpolicy="no-referrer">
            </div><p>ในโลกของการเขียนโปรแกรมด้วย Go การออกแบบฟังก์ชันให้ยืดหยุ่นและดูแลง่ายคือกุญแจสำคัญของการสร้างแอปที่แข็งแรง หนึ่งในแพทเทิร์นที่ทรงพลังมากคือ</p>
<blockquote>
<p>รับค่าเป็น <strong>interface</strong> แล้วคืนค่าเป็น <strong>struct</strong></p></blockquote>
<p>แนวคิดนี้ช่วยให้เทสง่ายขึ้น ลดการผูกติด (coupling) ระหว่างส่วนต่าง ๆ ในระบบ และทำให้โค้ดของเราปรับตัวตาม requirement ที่เปลี่ยนไปได้ดีขึ้นมาก</p>]]></description>
</item>
</channel>
</rss>
