{"id":174,"date":"2026-07-07T20:34:34","date_gmt":"2026-07-07T20:34:34","guid":{"rendered":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/"},"modified":"2026-07-07T20:38:25","modified_gmt":"2026-07-07T20:38:25","slug":"09-go-pointers","status":"publish","type":"post","link":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/","title":{"rendered":"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them"},"content":{"rendered":"<p><!-- ktg-updated-banner --><\/p>\n<div class=\"ktg-updated-banner\" style=\"margin:0 0 1.25em;padding:0.75em 1em;background:#fefce8;border-left:4px solid #ca8a04;border-radius:4px;\">\n<p><strong>Updated July 2, 2026.<\/strong> Refreshed for Go 1.22+ and current SEO best practices.<\/p>\n<\/div>\n<p>In this lesson we cover the <strong>Go pointers tutorial<\/strong> essentials \u2014 what pointers are, how to take addresses and dereference values, when to pass pointers to functions, and how pointers interact with structs and methods. If you completed <a href=\"https:\/\/www.kindsonthegenius.com\/go\/08-go-structs-and-methods\/\">Go Structs and Methods<\/a>, you already met pointer receivers on methods. Here we go deeper so you understand <em>why<\/em> Go uses pointers and how to avoid common mistakes.<\/p>\n<p><strong>Prerequisites:<\/strong> Lessons 1\u20138 completed, Go 1.22 or newer installed. <strong>Estimated time:<\/strong> 40\u201350 minutes.<\/p>\n<h4 id=\"what-are-pointers\">1. What Is a Pointer?<\/h4>\n<p>A <strong>pointer<\/strong> is a variable that stores the <em>memory address<\/em> of another value \u2014 not the value itself. In Go, you declare a pointer type by placing <code>*<\/code> before the underlying type. The zero value of a pointer is <code>nil<\/code>, meaning it points to nothing.<\/p>\n<p>Two operators work with pointers:<\/p>\n<ul>\n<li><code>&amp;<\/code> (address-of) \u2014 returns the memory address of a variable<\/li>\n<li><code>*<\/code> (dereference) \u2014 reads or writes the value at that address<\/li>\n<\/ul>\n<pre><code class=\"language-go\">package main\n\nimport \"fmt\"\n\nfunc main() {\n\tx := 42\n\tp := &amp;x \/\/ p is *int \u2014 address of x\n\n\tfmt.Println(\"value of x:\", x)       \/\/ 42\n\tfmt.Println(\"address stored in p:\", p)\n\tfmt.Println(\"value through p:\", *p) \/\/ dereference \u2014 42\n\n\t*p = 100 \/\/ change x through the pointer\n\tfmt.Println(\"x after *p = 100:\", x) \/\/ 100\n}\n<\/code><\/pre>\n<p>Unlike C, Go has no pointer arithmetic \u2014 you cannot add or subtract from a pointer to walk through memory. This design choice keeps Go memory-safe while still giving you direct control when you need it.<\/p>\n<h4 id=\"pointer-vs-value\">2. Pointers vs Values in Function Calls<\/h4>\n<p>Go passes arguments <strong>by value<\/strong> by default. When you pass an integer or a struct to a function, the function receives a <em>copy<\/em>. Changes inside the function do not affect the original unless you pass a pointer.<\/p>\n<pre><code class=\"language-go\">package main\n\nimport \"fmt\"\n\nfunc incrementValue(n int) {\n\tn++ \/\/ only changes the local copy\n}\n\nfunc incrementPointer(n *int) {\n\t*n++ \/\/ changes the original variable\n}\n\nfunc main() {\n\tcount := 10\n\tincrementValue(count)\n\tfmt.Println(\"after incrementValue:\", count) \/\/ 10 \u2014 unchanged\n\n\tincrementPointer(&amp;count)\n\tfmt.Println(\"after incrementPointer:\", count) \/\/ 11 \u2014 changed\n}\n<\/code><\/pre>\n<p>Use pointers when a function must modify the caller&#8217;s data, when copying a large struct would be expensive, or when you need to represent optional or shared state. For small values like integers and booleans, passing by value is often clearer and just as fast.<\/p>\n<h4 id=\"new-and-make\">3. Creating Pointers with new and Struct Literals<\/h4>\n<p>The built-in <code>new(T)<\/code> allocates memory for type <code>T<\/code>, zeroes it, and returns <code>*T<\/code>. For structs, the more idiomatic approach is a struct literal with <code>&amp;<\/code>:<\/p>\n<pre><code class=\"language-go\">package main\n\nimport \"fmt\"\n\ntype Book struct {\n\tTitle  string\n\tAuthor string\n\tPages  int\n}\n\nfunc main() {\n\t\/\/ new() \u2014 returns pointer to zero-valued Book\n\tb1 := new(Book)\n\tb1.Title = \"The Go Programming Language\"\n\tfmt.Println(b1.Title)\n\n\t\/\/ struct literal with &amp; \u2014 preferred style\n\tb2 := &amp;Book{\n\t\tTitle:  \"Concurrency in Go\",\n\t\tAuthor: \"Katherine Cox-Buday\",\n\t\tPages:  250,\n\t}\n\tfmt.Printf(\"%+v\\n\", b2)\n}\n<\/code><\/pre>\n<p>Both approaches produce a <code>*Book<\/code>. The struct literal form is more readable because you can set fields at creation time. Constructor functions like <code>NewBook(...)<\/code> that return <code>*Book<\/code> are common in production code \u2014 you saw this pattern with <code>NewAccount<\/code> in the Structs lesson.<\/p>\n<h4 id=\"nil-pointers\">4. Nil Pointers and Safety<\/h4>\n<p>Dereferencing a <code>nil<\/code> pointer causes a <strong>runtime panic<\/strong>. Always check whether a pointer is <code>nil<\/code> before dereferencing when the pointer might not be initialized:<\/p>\n<pre><code class=\"language-go\">package main\n\nimport \"fmt\"\n\ntype User struct {\n\tName string\n}\n\nfunc greet(u *User) {\n\tif u == nil {\n\t\tfmt.Println(\"no user provided\")\n\t\treturn\n\t}\n\tfmt.Println(\"Hello,\", u.Name)\n}\n\nfunc main() {\n\tvar u *User \/\/ nil pointer \u2014 zero value for *User\n\tgreet(u)    \/\/ safe \u2014 handled\n\n\tu = &amp;User{Name: \"Ada\"}\n\tgreet(u) \/\/ Hello, Ada\n}\n<\/code><\/pre>\n<p>Go&#8217;s type system does not prevent nil pointer dereferences at compile time. Defensive nil checks at API boundaries \u2014 especially in functions that accept pointers from callers \u2014 prevent crashes in production. Methods with pointer receivers can also be called on nil receivers in some cases (when the method does not dereference fields), but relying on that is rare.<\/p>\n<h4 id=\"pointer-receivers\">5. Pointer Receivers on Methods<\/h4>\n<p>When a method uses a <strong>pointer receiver<\/strong> <code>(t *Type)<\/code>, it can modify the struct and avoids copying large values on each call. This is the pattern you need for mutating methods and for consistency when any method on a type modifies state:<\/p>\n<pre><code class=\"language-go\">package main\n\nimport \"fmt\"\n\ntype Counter struct {\n\tcount int\n}\n\n\/\/ Value receiver \u2014 gets a copy; cannot change original\nfunc (c Counter) ValueReceiver() int {\n\treturn c.count\n}\n\n\/\/ Pointer receiver \u2014 can mutate the struct\nfunc (c *Counter) Increment() {\n\tc.count++\n}\n\nfunc (c *Counter) Current() int {\n\treturn c.count\n}\n\nfunc main() {\n\tc := Counter{}\n\tc.Increment()\n\tc.Increment()\n\tfmt.Println(c.Current()) \/\/ 2\n}\n<\/code><\/pre>\n<p>Go automatically takes the address when you call a pointer-receiver method on a value (<code>c.Increment()<\/code> works even though <code>c<\/code> is a value). The compiler inserts <code>(&amp;c).Increment()<\/code> behind the scenes. Choose pointer receivers when the method mutates the receiver or when the struct is large; use value receivers for small, immutable types.<\/p>\n<h4 id=\"pointers-with-slices\">6. Pointers, Slices, and Maps<\/h4>\n<p>Not everything needs an explicit pointer. <strong>Slices<\/strong> and <strong>maps<\/strong> are reference types \u2014 they internally hold a pointer to underlying data. Passing a slice to a function lets you modify elements without <code>*<\/code>:<\/p>\n<pre><code class=\"language-go\">package main\n\nimport \"fmt\"\n\nfunc addTag(tags []string, tag string) {\n\ttags = append(tags, tag) \/\/ may not change caller's slice header\n}\n\nfunc addTagPointer(tags *[]string, tag string) {\n\t*tags = append(*tags, tag) \/\/ changes caller's slice\n}\n\nfunc main() {\n\ttags := []string{\"go\", \"tutorial\"}\n\taddTag(tags, \"pointers\")\n\tfmt.Println(tags) \/\/ [go tutorial] \u2014 unchanged\n\n\taddTagPointer(&amp;tags, \"pointers\")\n\tfmt.Println(tags) \/\/ [go tutorial pointers]\n}\n<\/code><\/pre>\n<p>Understanding this distinction prevents over-using pointers. Modify slice <em>elements<\/em> through the slice directly; use a pointer to the slice only when you need to reassign the slice header (length, capacity, or backing array). Maps behave similarly \u2014 you pass the map value, but it references shared underlying data.<\/p>\n<h4 id=\"when-to-use\">7. When to Use Pointers \u2014 Practical Guidelines<\/h4>\n<p>Follow these guidelines when deciding between values and pointers in your Go code:<\/p>\n<ul>\n<li><strong>Use pointers<\/strong> when methods mutate struct state, when structs are large (dozens of fields or big arrays), or when <code>nil<\/code> represents &#8220;not present&#8221; (optional fields).<\/li>\n<li><strong>Use values<\/strong> for small, immutable data (coordinates, IDs, enums), for concurrency safety (copies avoid shared mutation), and when zero values are meaningful defaults.<\/li>\n<li><strong>Avoid<\/strong> pointers to primitives in public APIs unless mutation is required \u2014 they add cognitive overhead for little gain.<\/li>\n<\/ul>\n<p>These rules align with the standard library. Types like <code>time.Time<\/code> are structs passed by value because they are small and immutable. Types like <code>bytes.Buffer<\/code> use pointer receivers because they accumulate mutable state.<\/p>\n<h4 id=\"next\">8. Next Steps<\/h4>\n<p>You now understand <strong>Go pointers<\/strong> \u2014 addresses, dereferencing, nil safety, pointer receivers, and when to pass pointers versus values. In the next lesson we cover <strong>interfaces and error handling<\/strong> \u2014 Go&#8217;s approach to polymorphism and the idiomatic way to signal and handle failures.<\/p>\n<p>Continue the series: <a href=\"https:\/\/www.kindsonthegenius.com\/go\/08-go-structs-and-methods\/\">Lesson 8 \u2013 Structs and Methods<\/a> \u00b7 <a href=\"https:\/\/www.kindsonthegenius.com\/go\/10-go-interfaces-and-errors\/\">Lesson 10 \u2013 Interfaces and Errors<\/a><\/p>\n<h4 id=\"faq\">Frequently Asked Questions<\/h4>\n<p><strong>What is a pointer in Go?<\/strong><br \/>\nA pointer holds the memory address of a value. Use <code>&amp;<\/code> to get an address and <code>*<\/code> to read or write through it. The zero value is <code>nil<\/code>.<\/p>\n<p><strong>When should I use pointer receivers?<\/strong><br \/>\nUse pointer receivers when methods modify the struct, when the struct is large, or when you want consistency across all methods on a type. Value receivers work for small, immutable types.<\/p>\n<p><strong>Can Go pointers cause memory leaks?<\/strong><br \/>\nGo has garbage collection, so you do not manually free memory. However, holding pointers to large structures longer than needed can delay collection \u2014 design APIs to release references when done.<\/p>\n<p><!-- ktg-lesson-nav --><\/p>\n<nav class=\"ktg-lesson-nav\" aria-label=\"Lesson navigation\">\n<p><strong>Previous:<\/strong> <a href=\"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/08-go-structs-and-methods\/\">Lesson 8: Go Structs and Methods \u2013 Organizing Data and Behavior<\/a><\/p>\n<p><strong>Next:<\/strong> <a href=\"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/10-go-interfaces-and-errors\/\">Lesson 10: Go Interfaces and Errors \u2013 Polymorphism and Idiomatic Error Handling<\/a><\/p>\n<\/nav>\n<p><!-- ktg-alkademy-cta --><\/p>\n<div class=\"ktg-alkademy-cta\" style=\"margin:2em 0;padding:1.25em;border-left:4px solid #2563eb;background:#f8fafc;\">\n<p><strong>Want live Go or backend classes?<\/strong> Join <a href=\"https:\/\/www.alkademy.com\/courses\" target=\"_blank\" rel=\"noopener noreferrer\">Alkademy<\/a> for instructor-led programming courses with hands-on projects.<\/p>\n<\/div>\n<p><!-- ktg-faq-schema --><br \/>\n<script type=\"application\/ld+json\">{\"@context\":\"https:\/\/schema.org\",\"@type\":\"FAQPage\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"When should I use pointers in Go?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Use pointers when you need to modify a value, avoid copying large structs, or share state.\"}},{\"@type\":\"Question\",\"name\":\"Can you dereference a nil pointer in Go?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"No. Dereferencing nil causes a runtime panic. Always check for nil when needed.\"}},{\"@type\":\"Question\",\"name\":\"Does Go have pointer arithmetic?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"No. Unlike C, Go does not support pointer arithmetic for safety.\"}}]}<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Updated July 2, 2026. Refreshed for Go 1.22+ and current SEO best practices. In this lesson we cover the Go pointers tutorial essentials \u2014 what &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[23],"tags":[],"class_list":["post-174","post","type-post","status-publish","format-standard","hentry","category-go-programming"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"Updated July 2, 2026. Refreshed for Go 1.22+ and current SEO best practices. In this lesson we cover the Go pointers tutorial essentials \u2014 what pointers are, how to take addresses and dereference values, when to pass pointers to functions, and how pointers interact with structs and methods. If you completed Go Structs and Methods,\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"kindsonthegenius\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Go Programming Tutorial - Beginner to Expert Go Programming Tutorial\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them - Go Programming Tutorial\" \/>\n\t\t<meta property=\"og:description\" content=\"Updated July 2, 2026. Refreshed for Go 1.22+ and current SEO best practices. In this lesson we cover the Go pointers tutorial essentials \u2014 what pointers are, how to take addresses and dereference values, when to pass pointers to functions, and how pointers interact with structs and methods. If you completed Go Structs and Methods,\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2026-07-07T20:34:34+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-07-07T20:38:25+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them - Go Programming Tutorial\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Updated July 2, 2026. Refreshed for Go 1.22+ and current SEO best practices. In this lesson we cover the Go pointers tutorial essentials \u2014 what pointers are, how to take addresses and dereference values, when to pass pointers to functions, and how pointers interact with structs and methods. If you completed Go Structs and Methods,\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/2026\\\/07\\\/07\\\/09-go-pointers\\\/#blogposting\",\"name\":\"Go Pointers \\u2013 Addresses, Dereferencing, and When to Use Them - Go Programming Tutorial\",\"headline\":\"Go Pointers \\u2013 Addresses, Dereferencing, and When to Use Them\",\"author\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/author\\\/kindsonthegenius-3\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/#organization\"},\"datePublished\":\"2026-07-07T20:34:34+00:00\",\"dateModified\":\"2026-07-07T20:38:25+00:00\",\"inLanguage\":\"en-US\",\"commentCount\":1,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/2026\\\/07\\\/07\\\/09-go-pointers\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/2026\\\/07\\\/07\\\/09-go-pointers\\\/#webpage\"},\"articleSection\":\"Go Programming\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/2026\\\/07\\\/07\\\/09-go-pointers\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/category\\\/go-programming\\\/#listItem\",\"name\":\"Go Programming\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/category\\\/go-programming\\\/#listItem\",\"position\":2,\"name\":\"Go Programming\",\"item\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/category\\\/go-programming\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/2026\\\/07\\\/07\\\/09-go-pointers\\\/#listItem\",\"name\":\"Go Pointers \\u2013 Addresses, Dereferencing, and When to Use Them\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/2026\\\/07\\\/07\\\/09-go-pointers\\\/#listItem\",\"position\":3,\"name\":\"Go Pointers \\u2013 Addresses, Dereferencing, and When to Use Them\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/category\\\/go-programming\\\/#listItem\",\"name\":\"Go Programming\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/#organization\",\"name\":\"Go Programming Tutorial\",\"description\":\"Beginner to Expert Go Programming Tutorial\",\"url\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/author\\\/kindsonthegenius-3\\\/#author\",\"url\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/author\\\/kindsonthegenius-3\\\/\",\"name\":\"kindsonthegenius\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/2026\\\/07\\\/07\\\/09-go-pointers\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"kindsonthegenius\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/2026\\\/07\\\/07\\\/09-go-pointers\\\/#webpage\",\"url\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/2026\\\/07\\\/07\\\/09-go-pointers\\\/\",\"name\":\"Go Pointers \\u2013 Addresses, Dereferencing, and When to Use Them - Go Programming Tutorial\",\"description\":\"Updated July 2, 2026. Refreshed for Go 1.22+ and current SEO best practices. In this lesson we cover the Go pointers tutorial essentials \\u2014 what pointers are, how to take addresses and dereference values, when to pass pointers to functions, and how pointers interact with structs and methods. If you completed Go Structs and Methods,\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/2026\\\/07\\\/07\\\/09-go-pointers\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/author\\\/kindsonthegenius-3\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/author\\\/kindsonthegenius-3\\\/#author\"},\"datePublished\":\"2026-07-07T20:34:34+00:00\",\"dateModified\":\"2026-07-07T20:38:25+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/#website\",\"url\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/\",\"name\":\"Go Programming Tutorial\",\"description\":\"Beginner to Expert Go Programming Tutorial\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them - Go Programming Tutorial","description":"Updated July 2, 2026. Refreshed for Go 1.22+ and current SEO best practices. In this lesson we cover the Go pointers tutorial essentials \u2014 what pointers are, how to take addresses and dereference values, when to pass pointers to functions, and how pointers interact with structs and methods. If you completed Go Structs and Methods,","canonical_url":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/#blogposting","name":"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them - Go Programming Tutorial","headline":"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them","author":{"@id":"https:\/\/kindsonthegenius.com\/go\/author\/kindsonthegenius-3\/#author"},"publisher":{"@id":"https:\/\/kindsonthegenius.com\/go\/#organization"},"datePublished":"2026-07-07T20:34:34+00:00","dateModified":"2026-07-07T20:38:25+00:00","inLanguage":"en-US","commentCount":1,"mainEntityOfPage":{"@id":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/#webpage"},"isPartOf":{"@id":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/#webpage"},"articleSection":"Go Programming"},{"@type":"BreadcrumbList","@id":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/kindsonthegenius.com\/go#listItem","position":1,"name":"Home","item":"https:\/\/kindsonthegenius.com\/go","nextItem":{"@type":"ListItem","@id":"https:\/\/kindsonthegenius.com\/go\/category\/go-programming\/#listItem","name":"Go Programming"}},{"@type":"ListItem","@id":"https:\/\/kindsonthegenius.com\/go\/category\/go-programming\/#listItem","position":2,"name":"Go Programming","item":"https:\/\/kindsonthegenius.com\/go\/category\/go-programming\/","nextItem":{"@type":"ListItem","@id":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/#listItem","name":"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them"},"previousItem":{"@type":"ListItem","@id":"https:\/\/kindsonthegenius.com\/go#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/#listItem","position":3,"name":"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them","previousItem":{"@type":"ListItem","@id":"https:\/\/kindsonthegenius.com\/go\/category\/go-programming\/#listItem","name":"Go Programming"}}]},{"@type":"Organization","@id":"https:\/\/kindsonthegenius.com\/go\/#organization","name":"Go Programming Tutorial","description":"Beginner to Expert Go Programming Tutorial","url":"https:\/\/kindsonthegenius.com\/go\/"},{"@type":"Person","@id":"https:\/\/kindsonthegenius.com\/go\/author\/kindsonthegenius-3\/#author","url":"https:\/\/kindsonthegenius.com\/go\/author\/kindsonthegenius-3\/","name":"kindsonthegenius","image":{"@type":"ImageObject","@id":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g","width":96,"height":96,"caption":"kindsonthegenius"}},{"@type":"WebPage","@id":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/#webpage","url":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/","name":"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them - Go Programming Tutorial","description":"Updated July 2, 2026. Refreshed for Go 1.22+ and current SEO best practices. In this lesson we cover the Go pointers tutorial essentials \u2014 what pointers are, how to take addresses and dereference values, when to pass pointers to functions, and how pointers interact with structs and methods. If you completed Go Structs and Methods,","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/kindsonthegenius.com\/go\/#website"},"breadcrumb":{"@id":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/#breadcrumblist"},"author":{"@id":"https:\/\/kindsonthegenius.com\/go\/author\/kindsonthegenius-3\/#author"},"creator":{"@id":"https:\/\/kindsonthegenius.com\/go\/author\/kindsonthegenius-3\/#author"},"datePublished":"2026-07-07T20:34:34+00:00","dateModified":"2026-07-07T20:38:25+00:00"},{"@type":"WebSite","@id":"https:\/\/kindsonthegenius.com\/go\/#website","url":"https:\/\/kindsonthegenius.com\/go\/","name":"Go Programming Tutorial","description":"Beginner to Expert Go Programming Tutorial","inLanguage":"en-US","publisher":{"@id":"https:\/\/kindsonthegenius.com\/go\/#organization"}}]},"og:locale":"en_US","og:site_name":"Go Programming Tutorial - Beginner to Expert Go Programming Tutorial","og:type":"article","og:title":"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them - Go Programming Tutorial","og:description":"Updated July 2, 2026. Refreshed for Go 1.22+ and current SEO best practices. In this lesson we cover the Go pointers tutorial essentials \u2014 what pointers are, how to take addresses and dereference values, when to pass pointers to functions, and how pointers interact with structs and methods. If you completed Go Structs and Methods,","og:url":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/","article:published_time":"2026-07-07T20:34:34+00:00","article:modified_time":"2026-07-07T20:38:25+00:00","twitter:card":"summary_large_image","twitter:title":"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them - Go Programming Tutorial","twitter:description":"Updated July 2, 2026. Refreshed for Go 1.22+ and current SEO best practices. In this lesson we cover the Go pointers tutorial essentials \u2014 what pointers are, how to take addresses and dereference values, when to pass pointers to functions, and how pointers interact with structs and methods. If you completed Go Structs and Methods,"},"aioseo_meta_data":[],"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/kindsonthegenius.com\/go\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/kindsonthegenius.com\/go\/category\/go-programming\/\" title=\"Go Programming\">Go Programming<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tGo Pointers \u2013 Addresses, Dereferencing, and When to Use Them\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/kindsonthegenius.com\/go"},{"label":"Go Programming","link":"https:\/\/kindsonthegenius.com\/go\/category\/go-programming\/"},{"label":"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them","link":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/"}],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them | Go Programming Tutorial<\/title>\n<meta name=\"description\" content=\"Understand Go pointers \u2014 when to use them, pointer receivers, and common patterns. Lesson 9 in the free Go programming tutorial with clear examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them | Go Programming Tutorial\" \/>\n<meta property=\"og:description\" content=\"Understand Go pointers \u2014 when to use them, pointer receivers, and common patterns. Lesson 9 in the free Go programming tutorial with clear examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/\" \/>\n<meta property=\"og:site_name\" content=\"Go Programming Tutorial\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-07T20:34:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-07-07T20:38:25+00:00\" \/>\n<meta name=\"author\" content=\"kindsonthegenius\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"kindsonthegenius\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/2026\\\/07\\\/07\\\/09-go-pointers\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/2026\\\/07\\\/07\\\/09-go-pointers\\\/\"},\"author\":{\"name\":\"kindsonthegenius\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/#\\\/schema\\\/person\\\/1b5971e6d80495780d9857f155fd1b21\"},\"headline\":\"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them\",\"datePublished\":\"2026-07-07T20:34:34+00:00\",\"dateModified\":\"2026-07-07T20:38:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/2026\\\/07\\\/07\\\/09-go-pointers\\\/\"},\"wordCount\":922,\"commentCount\":1,\"articleSection\":[\"Go Programming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/2026\\\/07\\\/07\\\/09-go-pointers\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/2026\\\/07\\\/07\\\/09-go-pointers\\\/\",\"url\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/2026\\\/07\\\/07\\\/09-go-pointers\\\/\",\"name\":\"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them | Go Programming Tutorial\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/#website\"},\"datePublished\":\"2026-07-07T20:34:34+00:00\",\"dateModified\":\"2026-07-07T20:38:25+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/#\\\/schema\\\/person\\\/1b5971e6d80495780d9857f155fd1b21\"},\"description\":\"Understand Go pointers \u2014 when to use them, pointer receivers, and common patterns. Lesson 9 in the free Go programming tutorial with clear examples.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/2026\\\/07\\\/07\\\/09-go-pointers\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/2026\\\/07\\\/07\\\/09-go-pointers\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/2026\\\/07\\\/07\\\/09-go-pointers\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/#website\",\"url\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/\",\"name\":\"Go Programming Tutorial\",\"description\":\"Beginner to Expert Go Programming Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/#\\\/schema\\\/person\\\/1b5971e6d80495780d9857f155fd1b21\",\"name\":\"kindsonthegenius\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g\",\"caption\":\"kindsonthegenius\"},\"url\":\"https:\\\/\\\/kindsonthegenius.com\\\/go\\\/author\\\/kindsonthegenius-3\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them | Go Programming Tutorial","description":"Understand Go pointers \u2014 when to use them, pointer receivers, and common patterns. Lesson 9 in the free Go programming tutorial with clear examples.","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:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/","og_locale":"en_US","og_type":"article","og_title":"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them | Go Programming Tutorial","og_description":"Understand Go pointers \u2014 when to use them, pointer receivers, and common patterns. Lesson 9 in the free Go programming tutorial with clear examples.","og_url":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/","og_site_name":"Go Programming Tutorial","article_published_time":"2026-07-07T20:34:34+00:00","article_modified_time":"2026-07-07T20:38:25+00:00","author":"kindsonthegenius","twitter_card":"summary_large_image","twitter_misc":{"Written by":"kindsonthegenius","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/#article","isPartOf":{"@id":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/"},"author":{"name":"kindsonthegenius","@id":"https:\/\/kindsonthegenius.com\/go\/#\/schema\/person\/1b5971e6d80495780d9857f155fd1b21"},"headline":"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them","datePublished":"2026-07-07T20:34:34+00:00","dateModified":"2026-07-07T20:38:25+00:00","mainEntityOfPage":{"@id":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/"},"wordCount":922,"commentCount":1,"articleSection":["Go Programming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/","url":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/","name":"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them | Go Programming Tutorial","isPartOf":{"@id":"https:\/\/kindsonthegenius.com\/go\/#website"},"datePublished":"2026-07-07T20:34:34+00:00","dateModified":"2026-07-07T20:38:25+00:00","author":{"@id":"https:\/\/kindsonthegenius.com\/go\/#\/schema\/person\/1b5971e6d80495780d9857f155fd1b21"},"description":"Understand Go pointers \u2014 when to use them, pointer receivers, and common patterns. Lesson 9 in the free Go programming tutorial with clear examples.","breadcrumb":{"@id":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kindsonthegenius.com\/go\/2026\/07\/07\/09-go-pointers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kindsonthegenius.com\/go\/"},{"@type":"ListItem","position":2,"name":"Go Pointers \u2013 Addresses, Dereferencing, and When to Use Them"}]},{"@type":"WebSite","@id":"https:\/\/kindsonthegenius.com\/go\/#website","url":"https:\/\/kindsonthegenius.com\/go\/","name":"Go Programming Tutorial","description":"Beginner to Expert Go Programming Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kindsonthegenius.com\/go\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/kindsonthegenius.com\/go\/#\/schema\/person\/1b5971e6d80495780d9857f155fd1b21","name":"kindsonthegenius","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g","caption":"kindsonthegenius"},"url":"https:\/\/kindsonthegenius.com\/go\/author\/kindsonthegenius-3\/"}]}},"_links":{"self":[{"href":"https:\/\/kindsonthegenius.com\/go\/wp-json\/wp\/v2\/posts\/174","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kindsonthegenius.com\/go\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kindsonthegenius.com\/go\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/go\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/go\/wp-json\/wp\/v2\/comments?post=174"}],"version-history":[{"count":3,"href":"https:\/\/kindsonthegenius.com\/go\/wp-json\/wp\/v2\/posts\/174\/revisions"}],"predecessor-version":[{"id":194,"href":"https:\/\/kindsonthegenius.com\/go\/wp-json\/wp\/v2\/posts\/174\/revisions\/194"}],"wp:attachment":[{"href":"https:\/\/kindsonthegenius.com\/go\/wp-json\/wp\/v2\/media?parent=174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/go\/wp-json\/wp\/v2\/categories?post=174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/go\/wp-json\/wp\/v2\/tags?post=174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}