{"id":474,"date":"2026-06-06T09:00:00","date_gmt":"2026-06-06T03:30:00","guid":{"rendered":"https:\/\/smitabharat.com\/blog\/go-methods-receivers\/"},"modified":"2026-06-06T09:00:00","modified_gmt":"2026-06-06T03:30:00","slug":"go-methods-receivers","status":"publish","type":"post","link":"https:\/\/smitabharat.com\/blog\/go-methods-receivers\/","title":{"rendered":"Go Methods: Value vs Pointer Receivers Explained"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Go methods are functions that belong to a type, and they are how you add behaviour to your structs. In this post, you will learn how to write them and how value and pointer receivers differ. Then we will run one program that shows the difference clearly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This lesson builds on <a href=\"https:\/\/smitabharat.com\/blog\/go-structs-beginners-guide\/\">Go structs for beginners<\/a> and <a href=\"https:\/\/smitabharat.com\/blog\/go-pointers-explained\/\">Go pointers<\/a>. We also use ideas from <a href=\"https:\/\/smitabharat.com\/blog\/go-functions-beginners-guide\/\">Go functions<\/a> and <a href=\"https:\/\/smitabharat.com\/blog\/go-interfaces-examples\/\">Go interfaces<\/a>. So it helps to read those first.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What Are Go Methods?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A method is a function with one extra part, and that part is the receiver. Before the function name, you write a receiver in parentheses. The receiver says which type the method belongs to. After that, you call the method with a dot, such as <code>c.Value()<\/code>. After that, you call the method with a dot, such as <code>c.Value()<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Think of a remote control. The buttons only make sense for the TV they belong to, because each remote is built for one device. In the same way, a method only makes sense for its type, which is why Go methods feel natural. For example, a <code>Counter<\/code> can increase, and a <code>Celsius<\/code> value can convert itself to Fahrenheit.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Go has no classes. Instead, you define a type, usually a struct, and attach methods to it. This keeps the language small, and it still gives you clean, object style code. That is the whole idea behind Go methods.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Go Methods Matter<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You could write plain functions that take the type as an argument. However, Go methods add real benefits. Here is what they give you.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Grouping<\/strong>: behaviour sits next to the data it works on.<\/li>\n\n\n\n<li><strong>Shorter calls<\/strong>: <code>c.Inc()<\/code> reads better than <code>Inc(&amp;c)<\/code>.<\/li>\n\n\n\n<li><strong>Interfaces<\/strong>: only types with the right methods can satisfy an interface.<\/li>\n\n\n\n<li><strong>Clear intent<\/strong>: the receiver tells readers what the method may change.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Also, you can attach methods to any type you define in your package, not only structs. For instance, <code>type Celsius float64<\/code> can have its own methods. That is a handy way to add meaning to a simple number, since the type name explains the unit.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How Go Methods Work<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Underneath, a method call is just a function call in disguise. When you write <code>c.Inc()<\/code>, Go passes <code>c<\/code> as the first argument. So the big question is what kind of argument it is, and this question decides how Go methods behave. The receiver can be a value or a pointer. That choice changes everything, because it decides what the method can touch.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-diagram-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-diagram-1-1024x640.png\" alt=\"Go Methods diagram showing a value receiver working on a copy and a pointer receiver changing the original\" class=\"wp-image-454\" srcset=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-diagram-1-1024x640.png 1024w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-diagram-1-300x188.png 300w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-diagram-1-768x480.png 768w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-diagram-1-1536x960.png 1536w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-diagram-1-2048x1280.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">A value receiver gets a copy of the struct, so changes disappear when the method returns. A pointer receiver gets the address of the original, so changes stay.<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Value Receivers<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">With a value receiver, Go copies the struct before the method runs. The method can read and even change its copy, but the original stays the same. Use this for small types, and also for methods that only read.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Pointer Receivers<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">With a pointer receiver, Go passes the address of the original. As a result, the method changes the real data. Use this when the method must update the struct. Also use it when the struct is large, because copying would be wasteful.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Calling Pointer Methods on a Value<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You may have a plain variable and call a pointer method on it. Luckily, Go helps you here. If <code>c<\/code> is addressable, then <code>c.Inc()<\/code> is a short form of <code>(&amp;c).Inc()<\/code>. As a result, you rarely type the ampersand yourself.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Go Methods: Value vs Pointer Receivers<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The two kinds of receiver differ in several ways. The table below compares them side by side.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Feature<\/th><th>Value receiver<\/th><th>Pointer receiver<\/th><\/tr><\/thead><tbody><tr><td>Receiver syntax<\/td><td>func (c Counter)<\/td><td>func (c *Counter)<\/td><\/tr><tr><td>Gets<\/td><td>A copy of the value<\/td><td>The address of the original<\/td><\/tr><tr><td>Can change the original?<\/td><td>No<\/td><td>Yes<\/td><\/tr><tr><td>Cost for large structs<\/td><td>Copies all fields<\/td><td>Copies one address<\/td><\/tr><tr><td>Works on nil?<\/td><td>Panics on a nil pointer<\/td><td>Can check for nil<\/td><\/tr><tr><td>Method set of the value<\/td><td>Includes it<\/td><td>Excludes it<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-diagram-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-diagram-2-1024x640.png\" alt=\"Go Methods diagram showing the method sets of Counter and the Counter pointer type\" class=\"wp-image-455\" srcset=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-diagram-2-1024x640.png 1024w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-diagram-2-300x188.png 300w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-diagram-2-768x480.png 768w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-diagram-2-1536x960.png 1536w, https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-diagram-2-2048x1280.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Interface rules: the type Counter has only value methods in its method set, while the pointer type has both value and pointer methods.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The last row matters for interfaces. In short, the method set of <code>Counter<\/code> holds only value receiver methods. Meanwhile, <code>*Counter<\/code> holds both kinds. Therefore, if an interface needs a pointer method, you must pass a pointer. Our Go interfaces post covers this idea in more detail.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Go Methods Hands-On: A Counter<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now let&#8217;s write the code. Here we build a <code>Counter<\/code> with one method of each kind, so you can compare them.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Define the Type and Methods<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">First, <code>Counter<\/code> holds one number, which is easy to watch. Next, <code>IncByValue<\/code> uses a value receiver, so it changes a copy. Then <code>Inc<\/code> uses a pointer receiver, so it changes the original. Finally, <code>Value<\/code> only reads, so a value receiver is fine.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>type Counter struct{ n int }\n\nfunc (c Counter) IncByValue() { c.n++ }\n\nfunc (c *Counter) Inc() { c.n++ }\n\nfunc (c Counter) Value() int { return c.n }\n\ntype Valuer interface{ Value() int }\ntype Incer interface{ Inc() }\n\ntype Celsius float64\n\nfunc (c Celsius) ToF() float64 { return float64(c)*9\/5 + 32 }<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s look at the key lines. Both interfaces ask for one method each, so they are easy to read. The type <code>Celsius<\/code> shows that Go methods can belong to a plain number type.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Call the Methods<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Then we call each method and print the result. We also store the counter in two interfaces, so we can see how the method sets work.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>func main() {\n\tc := Counter{}\n\tc.IncByValue()\n\tfmt.Println(\"after IncByValue:\", c.Value())\n\tc.Inc()\n\tc.Inc()\n\tfmt.Println(\"after Inc twice:\", c.Value())\n\n\tvar v Valuer = c\n\tvar i Incer = &amp;c\n\ti.Inc()\n\tfmt.Println(\"via interfaces:\", v.Value(), c.Value())\n\n\ttemp := Celsius(100)\n\tfmt.Printf(\"%.1f C = %.1f F\\n\", float64(temp), temp.ToF())\n\n\tvar np *Counter\n\tfmt.Println(\"nil pointer is nil:\", np == nil)\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here is the real output from our run.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>after IncByValue: 0\nafter Inc twice: 2\nvia interfaces: 2 3\n100.0 C = 212.0 F\nnil pointer is nil: true<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">As you can see, <code>IncByValue<\/code> did nothing to the original, because it worked on a copy. Then the two <code>Inc<\/code> calls raised the value to 2. The interface line also shows something subtle. The <code>Valuer<\/code> holds a copy made when <code>c<\/code> was 2, so it still reads 2. After <code>i.Inc()<\/code>, the real counter is 3, so the two numbers differ. This output proves the difference between the two receivers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: See the Compile Error<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">What if you try to store the plain value in the <code>Incer<\/code> interface? Then Go refuses to compile it. The message also explains the problem well.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cannot use Counter{} (value of struct type Counter) as Incer value in variable declaration: Counter does not implement Incer (method Inc has pointer receiver)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This error is a gift, because it tells you exactly what to fix. You should pass <code>&amp;Counter{}<\/code> instead.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Which Receiver Should You Pick?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A simple rule helps in most cases. Ask three questions. Does the method change the struct? Is the struct large? Does the type already use pointer receivers elsewhere? When the answer to any is yes, choose a pointer receiver. Otherwise, a value receiver is fine. The table below turns the rule into examples.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Type<\/th><th>Example<\/th><th>Receiver<\/th><th>Reason<\/th><\/tr><\/thead><tbody><tr><td>Small read-only value<\/td><td>Celsius, a number<\/td><td>Value<\/td><td>Copy is cheap and safe<\/td><\/tr><tr><td>Struct that changes<\/td><td>Counter, Account<\/td><td>Pointer<\/td><td>Updates must stay<\/td><\/tr><tr><td>Large struct<\/td><td>A config with many fields<\/td><td>Pointer<\/td><td>Avoids a big copy<\/td><\/tr><tr><td>Struct with a mutex<\/td><td>A cache<\/td><td>Pointer<\/td><td>A copy would break the lock<\/td><\/tr><tr><td>Small struct, read only<\/td><td>A point with x and y<\/td><td>Value<\/td><td>Simple and predictable<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">When you are unsure, start with a pointer receiver. It is the safer default for structs, because it avoids surprise copies. Later, you can switch a small read-only type to a value receiver if it makes the code clearer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do not mix both kinds on one type unless you have a strong reason. Mixed receivers confuse readers, and they can break interface rules. So pick one style per type and keep to it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common Mistakes with Go Methods<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Changing a copy by accident<\/strong>: a value receiver cannot update the original. So use a pointer receiver when you need changes to stick.<\/li>\n\n\n\n<li><strong>Mixing receiver kinds<\/strong>: this makes the method set hard to predict. Therefore, choose one kind per type.<\/li>\n\n\n\n<li><strong>Calling a method on a nil pointer<\/strong>: a value receiver panics. Instead, use a pointer receiver and check for nil inside.<\/li>\n\n\n\n<li><strong>Copying a struct that holds a mutex<\/strong>: the copy has its own lock state. So use a pointer receiver for such types.<\/li>\n\n\n\n<li><strong>Storing a value where a pointer is needed<\/strong>: the compiler stops you, as we saw. Pass the address instead.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Best Practices for Go Methods<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Use pointer receivers for types that change<\/strong>, because the changes then reach the caller.<\/li>\n\n\n\n<li><strong>Use value receivers for small, read-only types<\/strong>, since copies are cheap and safe.<\/li>\n\n\n\n<li><strong>Keep receiver names short<\/strong>, such as <code>c<\/code> for a counter, because they appear in every method.<\/li>\n\n\n\n<li><strong>Never name the receiver this or self<\/strong>, since Go style prefers a short type-based name.<\/li>\n\n\n\n<li><strong>Add methods to named types<\/strong>, such as <code>Celsius<\/code>, when they give a number a clear meaning.<\/li>\n\n\n\n<li><strong>Keep Go methods small<\/strong>, so each one is easy to test.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Practice Task<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To practise Go methods, add a <code>Reset<\/code> method to <code>Counter<\/code> that sets the value back to zero. Then add a <code>String<\/code> method that prints <code>Counter(3)<\/code> for a counter with value 3.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Hint: <code>Reset<\/code> needs a pointer receiver, because it changes the struct. After that, print the counter with <code>fmt.Println(c)<\/code> and see how <code>String<\/code> changes the output.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Official Resources<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">These pages describe the language rules used in this lesson.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/go.dev\/tour\/methods\/1\">Tour of Go: Methods<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/go.dev\/ref\/spec#Method_declarations\">The Go specification: Method declarations<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/go.dev\/doc\/effective_go#pointers_vs_values\">Effective Go: Pointers vs. Values<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Quick Recap<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Go methods are functions with a receiver that belongs to a type.<\/li>\n\n\n\n<li>A value receiver works on a copy, and a pointer receiver works on the original.<\/li>\n\n\n\n<li>Go lets you call a pointer method on an addressable variable.<\/li>\n\n\n\n<li>The method set of a value type excludes pointer methods.<\/li>\n\n\n\n<li>Pick one receiver kind per type, and prefer pointers for types that change.<\/li>\n\n\n\n<li>Any named type, even a number type, can have methods.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What&#8217;s Next?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">By now, you can attach behaviour to your own types. However, many of the most useful interfaces in Go come from the standard library. So next, we will study <code>io.Reader<\/code> and <code>io.Writer<\/code>, which are two of the smallest and most powerful ones.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next up: <a href=\"https:\/\/smitabharat.com\/blog\/go-io-reader-writer\/\">Go Reader and Writer interfaces explained<\/a><\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>Go methods are functions that belong to a type, and they are how you add behaviour to your structs. In this post, you will&hellip;<\/p>\n","protected":false},"author":1,"featured_media":456,"comment_status":"","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_swapz_level":"","_swapz_series_part":0,"_swapz_hide_toc":false,"_swapz_hide_featured":false,"_swapz_description":"","footnotes":""},"categories":[15],"tags":[11,93,77],"swapz_series":[],"class_list":["post-474","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-go-lang","tag-go-lang","tag-go-methods","tag-intermediate"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Go Methods: Value vs Pointer Receivers Explained<\/title>\n<meta name=\"description\" content=\"Learn Go methods step by step. See how value and pointer receivers differ, how method sets affect interfaces, and which receiver to pick.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/smitabharat.com\/blog\/go-methods-receivers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Go Methods: Value vs Pointer Receivers Explained\" \/>\n<meta property=\"og:description\" content=\"Learn Go methods step by step. See how value and pointer receivers differ, how method sets affect interfaces, and which receiver to pick.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/smitabharat.com\/blog\/go-methods-receivers\/\" \/>\n<meta property=\"og:site_name\" content=\"Smita Bharat - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-06-06T03:30:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-featured.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Smita\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Smita\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-methods-receivers\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-methods-receivers\\\/\"},\"author\":{\"name\":\"Smita\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\"},\"headline\":\"Go Methods: Value vs Pointer Receivers Explained\",\"datePublished\":\"2026-06-06T03:30:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-methods-receivers\\\/\"},\"wordCount\":1552,\"publisher\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\"},\"image\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-methods-receivers\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-methods-receivers-featured.png\",\"keywords\":[\"Go Lang\",\"Go Methods\",\"Intermediate\"],\"articleSection\":[\"Go Lang\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-methods-receivers\\\/\",\"url\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-methods-receivers\\\/\",\"name\":\"Go Methods: Value vs Pointer Receivers Explained\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-methods-receivers\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-methods-receivers\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-methods-receivers-featured.png\",\"datePublished\":\"2026-06-06T03:30:00+00:00\",\"description\":\"Learn Go methods step by step. See how value and pointer receivers differ, how method sets affect interfaces, and which receiver to pick.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-methods-receivers\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-methods-receivers\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-methods-receivers\\\/#primaryimage\",\"url\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-methods-receivers-featured.png\",\"contentUrl\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/10\\\/go-methods-receivers-featured.png\",\"width\":2400,\"height\":1260,\"caption\":\"Go Methods featured image: value, pointer and method set cards\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/go-methods-receivers\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Go Methods: Value vs Pointer Receivers Explained\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/\",\"name\":\"Smita Bharat Blog\",\"description\":\"Golang &amp; Backend Development Tutorials and Interview Questions\",\"publisher\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\"},\"alternateName\":\"Smita Bharat\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/27a1b1067d396703215c54acedbfd339\",\"name\":\"Smita\",\"logo\":{\"@id\":\"https:\\\/\\\/smitabharat.com\\\/blog\\\/#\\\/schema\\\/person\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/smitabharat.com\\\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Go Methods: Value vs Pointer Receivers Explained","description":"Learn Go methods step by step. See how value and pointer receivers differ, how method sets affect interfaces, and which receiver to pick.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/smitabharat.com\/blog\/go-methods-receivers\/","og_locale":"en_US","og_type":"article","og_title":"Go Methods: Value vs Pointer Receivers Explained","og_description":"Learn Go methods step by step. See how value and pointer receivers differ, how method sets affect interfaces, and which receiver to pick.","og_url":"https:\/\/smitabharat.com\/blog\/go-methods-receivers\/","og_site_name":"Smita Bharat - Blog","article_published_time":"2026-06-06T03:30:00+00:00","og_image":[{"width":2400,"height":1260,"url":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-featured.png","type":"image\/png"}],"author":"Smita","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Smita","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/smitabharat.com\/blog\/go-methods-receivers\/#article","isPartOf":{"@id":"https:\/\/smitabharat.com\/blog\/go-methods-receivers\/"},"author":{"name":"Smita","@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339"},"headline":"Go Methods: Value vs Pointer Receivers Explained","datePublished":"2026-06-06T03:30:00+00:00","mainEntityOfPage":{"@id":"https:\/\/smitabharat.com\/blog\/go-methods-receivers\/"},"wordCount":1552,"publisher":{"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339"},"image":{"@id":"https:\/\/smitabharat.com\/blog\/go-methods-receivers\/#primaryimage"},"thumbnailUrl":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-featured.png","keywords":["Go Lang","Go Methods","Intermediate"],"articleSection":["Go Lang"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/smitabharat.com\/blog\/go-methods-receivers\/","url":"https:\/\/smitabharat.com\/blog\/go-methods-receivers\/","name":"Go Methods: Value vs Pointer Receivers Explained","isPartOf":{"@id":"https:\/\/smitabharat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/smitabharat.com\/blog\/go-methods-receivers\/#primaryimage"},"image":{"@id":"https:\/\/smitabharat.com\/blog\/go-methods-receivers\/#primaryimage"},"thumbnailUrl":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-featured.png","datePublished":"2026-06-06T03:30:00+00:00","description":"Learn Go methods step by step. See how value and pointer receivers differ, how method sets affect interfaces, and which receiver to pick.","breadcrumb":{"@id":"https:\/\/smitabharat.com\/blog\/go-methods-receivers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/smitabharat.com\/blog\/go-methods-receivers\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smitabharat.com\/blog\/go-methods-receivers\/#primaryimage","url":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-featured.png","contentUrl":"https:\/\/smitabharat.com\/blog\/wp-content\/uploads\/2026\/10\/go-methods-receivers-featured.png","width":2400,"height":1260,"caption":"Go Methods featured image: value, pointer and method set cards"},{"@type":"BreadcrumbList","@id":"https:\/\/smitabharat.com\/blog\/go-methods-receivers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/smitabharat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Go Methods: Value vs Pointer Receivers Explained"}]},{"@type":"WebSite","@id":"https:\/\/smitabharat.com\/blog\/#website","url":"https:\/\/smitabharat.com\/blog\/","name":"Smita Bharat Blog","description":"Golang &amp; Backend Development Tutorials and Interview Questions","publisher":{"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339"},"alternateName":"Smita Bharat","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/smitabharat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/27a1b1067d396703215c54acedbfd339","name":"Smita","logo":{"@id":"https:\/\/smitabharat.com\/blog\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/smitabharat.com\/blog"]}]}},"_links":{"self":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/posts\/474","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/comments?post=474"}],"version-history":[{"count":0,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/posts\/474\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/media\/456"}],"wp:attachment":[{"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/media?parent=474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/categories?post=474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/tags?post=474"},{"taxonomy":"swapz_series","embeddable":true,"href":"https:\/\/smitabharat.com\/blog\/wp-json\/wp\/v2\/swapz_series?post=474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}