<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Abdulrahman Masoud</title>
    <description>The latest articles on DEV Community by Abdulrahman Masoud (@theamasoud).</description>
    <link>https://dev.to/theamasoud</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F307867%2Ff1919832-69cc-4398-9868-d9e59550600d.jpg</url>
      <title>DEV Community: Abdulrahman Masoud</title>
      <link>https://dev.to/theamasoud</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/theamasoud"/>
    <language>en</language>
    <item>
      <title>9 Best Claude Prompt Templates for Developers (Token-Saving Daily Pack)</title>
      <dc:creator>Abdulrahman Masoud</dc:creator>
      <pubDate>Thu, 15 Jan 2026 10:06:48 +0000</pubDate>
      <link>https://dev.to/theamasoud/9-best-claude-prompt-templates-for-developers-token-saving-daily-pack-4ofh</link>
      <guid>https://dev.to/theamasoud/9-best-claude-prompt-templates-for-developers-token-saving-daily-pack-4ofh</guid>
      <description>&lt;p&gt;Claude is insanely useful for coding — but if you use it like a chat buddy (small tweaks, endless back-and-forth), you'll burn your usage fast.&lt;/p&gt;

&lt;p&gt;This post is a &lt;strong&gt;copy/paste pack of prompt templates&lt;/strong&gt; I use daily to get &lt;strong&gt;high-quality output in fewer messages&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Golden rule:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Claude = the brain (big moves)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Your IDE (Cursor/VSCode) = the hands (small edits)&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  How to Save Tokens With Claude (Quick Rules)
&lt;/h2&gt;

&lt;p&gt;Before the templates, here are the rules that make them work:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One prompt = one feature&lt;/strong&gt; (avoid "and also… and also…")&lt;/li&gt;
&lt;li&gt;Ask for &lt;strong&gt;PATCHES / diffs&lt;/strong&gt;, not full files&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;phases&lt;/strong&gt;: plan first → code second → review last&lt;/li&gt;
&lt;li&gt;Paste only what matters: &lt;strong&gt;3–8 files max&lt;/strong&gt;, or small snippets&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  1) The Daily “Build a Feature” One-Shot (Most Used)
&lt;/h1&gt;

&lt;p&gt;Use this when you want Claude to implement a feature end-to-end with minimal back-and-forth.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are a senior full-stack engineer.

Project: [name + stack]
Goal: Implement feature: [feature name]

Context (only what matters):
- Tech: [frameworks/libs]
- Relevant files: [list 3–8 file paths]
- Current behavior: [1–2 sentences]
- Expected behavior: [1–2 sentences]
- Constraints: [performance, RTL, no deps, etc.]

Task:
1) Propose the simplest plan (5–8 steps).
2) Produce code as PATCHES grouped by file:
   - File: path/to/file
   - Patch: only changed/added lines (no full file unless necessary)
3) Provide a short manual test checklist.

Output rules:
- No long explanations
- Ask at most 2 questions ONLY if blocking
- Prefer minimal diffs over rewrites

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  2) “Plan First, Stop” (Token Saver for Big Work)
&lt;/h1&gt;

&lt;p&gt;Use this before a large feature to avoid wasting tokens generating code in the wrong direction.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Act as a senior engineer.

I want to implement: [feature]
Stack: [stack]

First: produce ONLY
1) Architecture / approach
2) File list (new/changed)
3) Data flow
4) Edge cases
5) Risks

STOP after planning and ask: "Continue to patches?"
Rules: no code in this phase.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  3) Debug in One Pass (No Endless Chat)
&lt;/h1&gt;

&lt;p&gt;This template forces Claude to rank likely causes and give you the fastest confirmation tests.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are a senior debugger. Solve in one pass.

Problem:
- Error: [paste error]
- Where: [route/action/job]
- When: [steps to reproduce]
- Expected: [1 sentence]
- What I tried: [bullets]

Relevant code (smallest snippet + file path):
[paste]

Logs (only last relevant lines):
[paste]

Deliver:
1) Root cause (1–2 sentences)
2) Minimal fix as patches by file
3) Why it works (max 5 bullets)
4) Fast verification steps (max 5)

Rules:
- Do not ask for more info unless absolutely required
- If multiple causes, rank them + give a quick test for each
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  4) Refactor With Guardrails (Small, Safe Diffs)
&lt;/h1&gt;

&lt;p&gt;Use this when a file is messy but you can’t risk breaking behavior.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are a senior engineer. Refactor with minimal risk.

Target:
- File/module: [path]
- Objective: [readability/performance/structure]
- Non-goals: [do NOT change behavior, public API, output HTML, etc.]

Constraints:
- Keep diff small
- No new dependencies
- Maintain existing function signatures

Deliver:
1) Refactor plan (max 6 steps)
2) Patch per file (only changed lines)
3) Verification checklist
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  5) Code Review (Strict + Actionable)
&lt;/h1&gt;

&lt;p&gt;Use this to get meaningful review output + small fixes without dumping your whole repo.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Act as a strict code reviewer.

Context:
- Stack: [stack]
- Code style goals: [simplicity, performance, readability]
- Constraints: [no new deps, etc.]

Review these files/snippets:
[Paste or list file + snippet]

Deliver:
- Top issues ranked by severity (max 10)
- Minimal patches for top 3 issues
- Optional improvements (max 5)
Rules: no long explanations.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  6) “Generate Scaffolding Only” (When You Don’t Want Full Code Yet)
&lt;/h1&gt;

&lt;p&gt;This is perfect for avoiding huge token usage on implementations you may rewrite anyway.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are generating scaffolding only.

Project: [name]
Feature: [name]

Deliver ONLY:
1) Folder/file structure
2) Interfaces/contracts
3) Controller/service skeletons
4) TODO markers (clear next steps)

Rules:
- No full implementations
- Each file max ~60 lines
- Output per file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  7) Implement UI Component Pack (Design → Components)
&lt;/h1&gt;

&lt;p&gt;Great when you’re converting a design into consistent UI building blocks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Act as a UI engineer.

Goal: Build a reusable component pack for:
- [buttons, inputs, cards, modals, alerts...]

Design requirements:
[paste]

Constraints:
- Accessibility required (ARIA/keyboard)
- Mobile-first
- RTL-ready if needed
- Keep it framework-native (no heavy libs)

Deliver:
1) Component list + props
2) File outputs per component
3) Usage examples (short)
Rules: avoid repeated code blocks.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  8) “Work in Phases” (Stops Claude From Spamming Output)
&lt;/h1&gt;

&lt;p&gt;Use this when you want Claude to produce controlled outputs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Work in phases. After each phase, STOP and ask "Continue?"

Phase 1: Plan + file list
Phase 2: Core patches
Phase 3: Edge cases + polish
Phase 4: Tests/checklist

Start with Phase 1 only.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  9) Convert Requirements → Implementation Checklist (No Code)
&lt;/h1&gt;

&lt;p&gt;Useful when you want clarity before spending tokens on code generation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;9) Convert Requirements → Implementation Checklist (No Code)

Useful when you want clarity before spending tokens on code generation.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>programming</category>
      <category>ai</category>
      <category>coding</category>
      <category>webdev</category>
    </item>
    <item>
      <title>What are pointers in golang</title>
      <dc:creator>Abdulrahman Masoud</dc:creator>
      <pubDate>Sun, 01 May 2022 13:25:03 +0000</pubDate>
      <link>https://dev.to/theamasoud/what-are-pointers-in-golang-2kmc</link>
      <guid>https://dev.to/theamasoud/what-are-pointers-in-golang-2kmc</guid>
      <description>&lt;p&gt;Hi, I'm Abdulrahman, and I'm glad to share this blog, in this blog we will talk about &lt;strong&gt;Pointers&lt;/strong&gt; in golang.&lt;/p&gt;

&lt;p&gt;Pointer is a variable that references a memory location where a value is stored so before digging deeper into pointers we should know what are variables and how variables work.&lt;/p&gt;

&lt;h3&gt;
  
  
  What are variables
&lt;/h3&gt;

&lt;p&gt;Variables are placeholder of the information to store the  value for any data type you need like &lt;code&gt;string, integr, boolen, float, etc..&lt;/code&gt;&lt;br&gt;
basically, if we have a string we can assign it to any variable, and then we can access this string by the name of the variable declared, so how variable stored this string&lt;br&gt;
every variable you assign it, so when you assign a variable it will be assigned to a &lt;code&gt;memory address&lt;/code&gt; in the computer.&lt;/p&gt;
&lt;h3&gt;
  
  
  Let's deg deeper into pointers
&lt;/h3&gt;

&lt;p&gt;Pointers is a way to store the &lt;code&gt;memory address&lt;/code&gt; for any type of variable.&lt;/p&gt;
&lt;h3&gt;
  
  
  Why we need to use pointers?
&lt;/h3&gt;

&lt;p&gt;first we need to know how variables works like we explain above is &lt;code&gt;the name given to a memory location is pointing to the stored data&lt;/code&gt;&lt;br&gt;
we need pointers to store the memory address of another variable to can access the value of this memory location to make any operation on this value you can change the value for this address, note: when you try to change this value by memory address you actually replace the old value by the new value.&lt;/p&gt;
&lt;h3&gt;
  
  
  Syntax to declare a pointers
&lt;/h3&gt;

&lt;p&gt;first, you need to know the two important operators we will use in pointers&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;*&lt;/code&gt;: this asterisk operator used to declare pointer variable&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;amp;&lt;/code&gt;: this and to return the address of a variable you are added a pointer on it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;so to declare a pointer, we need to use &lt;code&gt;*&lt;/code&gt; and assign this asterisk to the data type in the variable declared, and you need to use &lt;code&gt;&amp;amp;&lt;/code&gt; before the new variable to get the memory address for the pointed variable&lt;/p&gt;
&lt;h4&gt;
  
  
  Examples
&lt;/h4&gt;
&lt;h5&gt;
  
  
  Example 1
&lt;/h5&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"fmt"&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;me&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c"&gt;// Result nil&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;me&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c"&gt;// Result 0xc00000e028&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;in the above example, we declare a new variable &lt;code&gt;name&lt;/code&gt; and make it a pointer by adding &lt;code&gt;*&lt;/code&gt; to the data type and declare another variable&lt;br&gt;
&lt;code&gt;me&lt;/code&gt; and make it pointed to a memory address for variable &lt;code&gt;name&lt;/code&gt; by adding &lt;code&gt;&amp;amp;&lt;/code&gt; to the &lt;code&gt;name&lt;/code&gt; variable, so let's see the results&lt;br&gt;
result for variable &lt;code&gt;name&lt;/code&gt; is &lt;code&gt;nil&lt;/code&gt; why nil? because we didn't assign any value for it&lt;br&gt;
and the result for variable &lt;code&gt;me&lt;/code&gt; is &lt;code&gt;0xc00000e028&lt;/code&gt; what is this hash? this is the address for a location in memory, why return this result? because we declare variable &lt;code&gt;me&lt;/code&gt; as a reference for variable &lt;code&gt;name&lt;/code&gt; and this reference pointed to the memory address for &lt;code&gt;name&lt;/code&gt; variable in the memory location.&lt;/p&gt;
&lt;h5&gt;
  
  
  Example 2
&lt;/h5&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"fmt"&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;100&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;
    &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;50&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c"&gt;//Result 50&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c"&gt;//Result  0xc0000ba000&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;in the above example, we declare a variable &lt;code&gt;x&lt;/code&gt; and assign &lt;code&gt;100&lt;/code&gt; value to it, and declare another variable &lt;code&gt;y&lt;/code&gt; it's a pointer and its value of it is a reference to variable &lt;code&gt;x&lt;/code&gt;&lt;br&gt;
and assign a &lt;code&gt;50&lt;/code&gt; for a pointer of &lt;code&gt;y&lt;/code&gt; variable,&lt;br&gt;
so why the result of &lt;code&gt;x&lt;/code&gt; is &lt;code&gt;50&lt;/code&gt;? because we add the reference of variable &lt;code&gt;x&lt;/code&gt; to pointer &lt;code&gt;y&lt;/code&gt; here &lt;code&gt;y&lt;/code&gt; is pointed a memory address of &lt;code&gt;x&lt;/code&gt; if we change the value of &lt;code&gt;y&lt;/code&gt; or &lt;code&gt;x&lt;/code&gt; it will change both because these two variables pointed to the same memory address&lt;br&gt;
if we assigned a new value for &lt;code&gt;x&lt;/code&gt; it will change the value for &lt;code&gt;*y&lt;/code&gt; like this &lt;strong&gt;example&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"fmt"&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;100&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;
    &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;50&lt;/span&gt;
    &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;25&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c"&gt;//Result 25&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c"&gt;//Result  0xc0000ba000&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;here result will be &lt;code&gt;25&lt;/code&gt; why? because the variables has the same memory address.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; when we need to print a value for a pointer we need to print it using &lt;code&gt;*&lt;/code&gt; like we did above with variable y &lt;code&gt;*y&lt;/code&gt; and if we tried to print it without add &lt;code&gt;*&lt;/code&gt; before it will print a memory address for this variable&lt;/p&gt;

&lt;h5&gt;
  
  
  Example 2 (Pointer to a Struct Syntax)
&lt;/h5&gt;

&lt;p&gt;pointer to a struct is just like any other pointer.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"fmt"&lt;/span&gt;

&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;User&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;FirstName&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;LastName&lt;/span&gt;  &lt;span class="kt"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;User&lt;/span&gt;
    &lt;span class="n"&gt;abdulrahman&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;User&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"Abdulrahman"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Masoud"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;abdulrahman&lt;/span&gt;

    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c"&gt;//0xc00000e028&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FirstName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c"&gt;//Abdulrahman&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;in the above example we declare a struct &lt;code&gt;User&lt;/code&gt; it has FirstName and LastName and in &lt;code&gt;main function&lt;/code&gt; and add a new &lt;code&gt;var user&lt;/code&gt; to assign a pointer of &lt;code&gt;struct User&lt;/code&gt;&lt;br&gt;
and add a new user called &lt;code&gt;abdulrahman&lt;/code&gt; to make a new user and tell &lt;code&gt;user var is equal a reference of abdulrahman&lt;/code&gt;&lt;/p&gt;
&lt;h5&gt;
  
  
  Example 3 (Pointer to a Struct)
&lt;/h5&gt;

&lt;p&gt;We can simply pass a pointer to a struct in the function and then manipulate the struct using the function via the pointer. Let’s see how one would do that.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"fmt"&lt;/span&gt;

&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;User&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;FirstName&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;LastName&lt;/span&gt;  &lt;span class="kt"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;change&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;User&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;LastName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Masoud"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;User&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"Abdulrahman"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Salah"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c"&gt;//{Abdulrahman Salah}&lt;/span&gt;
    &lt;span class="n"&gt;change&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c"&gt;//{Abdulrahman Masoud}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;in above example we declare a new function &lt;code&gt;change&lt;/code&gt; and pass a pointer of User as argument and then use it to change the LastName&lt;br&gt;
What happens is that,the pointer changes it at the original value.&lt;/p&gt;

&lt;p&gt;This is extremely useful since we want to change the original rather than a copy of it.&lt;/p&gt;

&lt;h4&gt;
  
  
  End of blog
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Variables are placeholder of the information to store the  value for any data type.&lt;/li&gt;
&lt;li&gt;Pointer is a variable that references a memory location.&lt;/li&gt;
&lt;li&gt;when you assign a variable it will be assigned to a memory address&lt;/li&gt;
&lt;li&gt;we need pointers to store the memory address of another variable&lt;/li&gt;
&lt;li&gt;when you try to change the value by memory address you actually replace the old value by the new value.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;*&lt;/code&gt; asterisk operator used to declare pointer variable&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;amp;&lt;/code&gt; and operator to return the address of a variable you are added a pointer on it&lt;/li&gt;
&lt;li&gt;pointer to a struct is just like any other pointer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;I hope you enjoy this kickoff to a new blog in Golang,&lt;br&gt;
Looking forward to sharing these blogs with you.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>go</category>
      <category>tutorial</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>What are methods in golang</title>
      <dc:creator>Abdulrahman Masoud</dc:creator>
      <pubDate>Thu, 14 Apr 2022 22:53:10 +0000</pubDate>
      <link>https://dev.to/theamasoud/what-are-methods-in-golang-4b5g</link>
      <guid>https://dev.to/theamasoud/what-are-methods-in-golang-4b5g</guid>
      <description>&lt;p&gt;Hi, I'm Abdulrahman I'm glad to share this blog, in this blog we will talk about methods in golang.&lt;br&gt;
so first we must know Go does not have classes because it doesn't support Object-oriented  programming.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is Object-oriented
&lt;/h2&gt;

&lt;p&gt;Object-oriented its way to allow programmers to declare a function inside the class definition. Go doesn't allow us to do that, we have to declare a method on a struct via a special syntax&lt;/p&gt;

&lt;p&gt;because Golang doesn't support Object-oriented  programming but Golang has Methods.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is Methods in golang
&lt;/h2&gt;

&lt;p&gt;Method is a function with a special &lt;code&gt;receiver&lt;/code&gt; argument and this method can access the properties of the receiver. &lt;code&gt;Receiver here can be type struct or non type struct like(int-string-etc...)&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  let's see the syntax with example
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="n"&gt;ReceiverType&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;funcName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="c"&gt;/*code*/&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this above example is ho we define a method for any &lt;code&gt;Receiver here is =&amp;gt; YourStruct&lt;/code&gt;&lt;br&gt;
Let’s see a full example to understand how to define a method on a type and how to invoke such a method&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;User&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c"&gt;//define a struct&lt;/span&gt;
    &lt;span class="n"&gt;FirstName&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;LastName&lt;/span&gt;  &lt;span class="kt"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;in above example we defined a struct has &lt;code&gt;FirstName-LastName&lt;/code&gt; and if we want to get the FullName  we can get them like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"fmt"&lt;/span&gt;

&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;User&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
    &lt;span class="n"&gt;FirstName&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;LastName&lt;/span&gt;  &lt;span class="kt"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;User&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s"&gt;"Abdulrahman"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s"&gt;"Masoud"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FirstName&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s"&gt;" "&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;LastName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c"&gt;// Result =&amp;gt; Abdulrahman Masoud&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;but in GoLang you are allowed to define a method whose receiver is your struct like we say before.&lt;br&gt;
This receiver is accessible inside the method as shown in the below example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"fmt"&lt;/span&gt;

&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;User&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c"&gt;//define a struct&lt;/span&gt;
    &lt;span class="n"&gt;FirstName&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;LastName&lt;/span&gt;  &lt;span class="kt"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;// GetFullName method to get full name&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="n"&gt;User&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GetFullName&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FirstName&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;LastName&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;User&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s"&gt;"Abdulrahman"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s"&gt;"Masoud"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GetFullName&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="c"&gt;// Result =&amp;gt; Abdulrahman Masoud&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In above example we defined a struct that has the inputs that I need and second, we defined a &lt;code&gt;GetFullName&lt;/code&gt; method and add a receiver for this method &lt;code&gt;(u User) =&amp;gt; this is the receiver of method&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Let's define non type struct
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"fmt"&lt;/span&gt;

&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Age&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;Age&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;GetAgeAfterTenYears&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;Age&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;22&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GetAgeAfterTenYears&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="c"&gt;// Result =&amp;gt; 32&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In above example we defined an Age type it's not a struct type its non type struct like we say before &lt;code&gt;Receiver here can be type struct or non type struct&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  End of blog
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go does not have classes because it doesn't support Object-oriented&lt;/li&gt;
&lt;li&gt;Golang doesn't support Object-oriented  programming but Golang has Methods&lt;/li&gt;
&lt;li&gt;Method is a function with a special receiver&lt;/li&gt;
&lt;li&gt;Receiver is type&lt;/li&gt;
&lt;li&gt;Receiver can be type struct or non type struct&lt;/li&gt;
&lt;li&gt;method can access the properties of the receiver&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;I hope you enjoy this kickoff to a new blog in Golang,&lt;br&gt;
Looking forward to sharing these blogs with you.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>go</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
