[{"data":1,"prerenderedAt":966},["ShallowReactive",2],{"navigation_docs":3,"-standard-library-overview":377,"-standard-library-overview-surround":961},[4,39,114,144,184,244,293,362],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Getting Started",false,"\u002Fgetting-started","1.getting-started",[10,15,20,25,30,35],{"title":11,"path":12,"stem":13,"icon":14},"Learning Path","\u002Fgetting-started\u002Flearning-path","1.getting-started\u002F1.learning-path","i-lucide-map",{"title":16,"path":17,"stem":18,"icon":19},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F2.introduction","i-lucide-house",{"title":21,"path":22,"stem":23,"icon":24},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F3.installation","i-lucide-download",{"title":26,"path":27,"stem":28,"icon":29},"Your First Program","\u002Fgetting-started\u002Ffirst-program","1.getting-started\u002F4.first-program","i-lucide-play",{"title":31,"path":32,"stem":33,"icon":34},"Modules and Dependencies","\u002Fgetting-started\u002Fmodules-and-dependencies","1.getting-started\u002F5.modules-and-dependencies","i-lucide-package-open",{"title":36,"path":37,"stem":38,"icon":34},"Advanced Modules","\u002Fgetting-started\u002Fadvanced-modules","1.getting-started\u002F6.advanced-modules",{"title":40,"path":41,"stem":42,"children":43,"page":6},"Fundamentals","\u002Ffundamentals","2.fundamentals",[44,49,54,59,64,69,74,79,84,89,94,99,104,109],{"title":45,"path":46,"stem":47,"icon":48},"Program Structure","\u002Ffundamentals\u002Fprogram-structure","2.fundamentals\u002F1.program-structure","i-lucide-workflow",{"title":50,"path":51,"stem":52,"icon":53},"Structs and Methods","\u002Ffundamentals\u002Fstructs-and-methods","2.fundamentals\u002F10.structs-and-methods","i-lucide-box",{"title":55,"path":56,"stem":57,"icon":58},"Interfaces","\u002Ffundamentals\u002Finterfaces","2.fundamentals\u002F11.interfaces","i-lucide-plug",{"title":60,"path":61,"stem":62,"icon":63},"Error Handling","\u002Ffundamentals\u002Ferrors","2.fundamentals\u002F12.errors","i-lucide-triangle-alert",{"title":65,"path":66,"stem":67,"icon":68},"Defined Types and Type Aliases","\u002Ffundamentals\u002Fdefined-types","2.fundamentals\u002F13.defined-types","i-lucide-tags",{"title":70,"path":71,"stem":72,"icon":73},"Generics","\u002Ffundamentals\u002Fgenerics","2.fundamentals\u002F14.generics","i-lucide-blocks",{"title":75,"path":76,"stem":77,"icon":78},"Project Structure","\u002Ffundamentals\u002Fproject-structure","2.fundamentals\u002F2.project-structure","i-lucide-folder-tree",{"title":80,"path":81,"stem":82,"icon":83},"Project Layout","\u002Ffundamentals\u002Fproject-layout","2.fundamentals\u002F3.project-layout","i-lucide-layout",{"title":85,"path":86,"stem":87,"icon":88},"Variables and Data Types","\u002Ffundamentals\u002Fvariables-and-types","2.fundamentals\u002F4.variables-and-types","i-lucide-variable",{"title":90,"path":91,"stem":92,"icon":93},"Functions","\u002Ffundamentals\u002Ffunctions","2.fundamentals\u002F5.functions","i-lucide-braces",{"title":95,"path":96,"stem":97,"icon":98},"Control Statements","\u002Ffundamentals\u002Fcontrol-statements","2.fundamentals\u002F6.control-statements","i-lucide-git-branch",{"title":100,"path":101,"stem":102,"icon":103},"Pointers","\u002Ffundamentals\u002Fpointers","2.fundamentals\u002F7.pointers","i-lucide-mouse-pointer-2",{"title":105,"path":106,"stem":107,"icon":108},"Arrays and Slices","\u002Ffundamentals\u002Farrays-and-slices","2.fundamentals\u002F8.arrays-and-slices","i-lucide-list",{"title":110,"path":111,"stem":112,"icon":113},"Maps","\u002Ffundamentals\u002Fmaps","2.fundamentals\u002F9.maps","i-lucide-table-properties",{"title":115,"path":116,"stem":117,"children":118,"page":6},"Concurrency","\u002Fconcurrency","3.concurrency",[119,124,129,134,139],{"title":120,"path":121,"stem":122,"icon":123},"Concurrency Model","\u002Fconcurrency\u002Fconcurrency-model","3.concurrency\u002F1.concurrency-model","i-lucide-network",{"title":125,"path":126,"stem":127,"icon":128},"Goroutines","\u002Fconcurrency\u002Fgoroutines","3.concurrency\u002F2.goroutines","i-lucide-git-fork",{"title":130,"path":131,"stem":132,"icon":133},"Channels","\u002Fconcurrency\u002Fchannels","3.concurrency\u002F3.channels","i-lucide-arrow-left-right",{"title":135,"path":136,"stem":137,"icon":138},"Select and Cancellation","\u002Fconcurrency\u002Fselect-and-cancellation","3.concurrency\u002F4.select-and-cancellation","i-lucide-circle-stop",{"title":140,"path":141,"stem":142,"icon":143},"Synchronization","\u002Fconcurrency\u002Fsynchronization","3.concurrency\u002F5.synchronization","i-lucide-lock-keyhole",{"title":145,"path":146,"stem":147,"children":148,"page":6},"Standard Library","\u002Fstandard-library","4.standard-library",[149,154,159,164,169,174,179],{"title":150,"path":151,"stem":152,"icon":153},"Standard Library Overview","\u002Fstandard-library\u002Foverview","4.standard-library\u002F1.overview","i-lucide-library",{"title":155,"path":156,"stem":157,"icon":158},"Text and Formatting","\u002Fstandard-library\u002Ftext-and-formatting","4.standard-library\u002F2.text-and-formatting","i-lucide-text",{"title":160,"path":161,"stem":162,"icon":163},"Files and JSON","\u002Fstandard-library\u002Ffiles-and-json","4.standard-library\u002F3.files-and-json","i-lucide-file-json",{"title":165,"path":166,"stem":167,"icon":168},"HTTP Clients and Servers","\u002Fstandard-library\u002Fhttp","4.standard-library\u002F4.http","i-lucide-server",{"title":170,"path":171,"stem":172,"icon":173},"Testing","\u002Fstandard-library\u002Ftesting","4.standard-library\u002F5.testing","i-lucide-flask-conical",{"title":175,"path":176,"stem":177,"icon":178},"Command-Line Tools and Configuration","\u002Fstandard-library\u002Fcommand-line-and-configuration","4.standard-library\u002F6.command-line-and-configuration","i-lucide-terminal-square",{"title":180,"path":181,"stem":182,"icon":183},"Structured Logging","\u002Fstandard-library\u002Fstructured-logging","4.standard-library\u002F7.structured-logging","i-lucide-scroll-text",{"title":185,"path":186,"stem":187,"children":188,"page":6},"Backend Development","\u002Fbackend-development","5.backend-development",[189,194,199,204,209,214,219,224,229,234,239],{"title":190,"path":191,"stem":192,"icon":193},"Backend Roadmap","\u002Fbackend-development\u002Fbackend-roadmap","5.backend-development\u002F1.backend-roadmap","i-lucide-route",{"title":195,"path":196,"stem":197,"icon":198},"Graceful Shutdown","\u002Fbackend-development\u002Fgraceful-shutdown","5.backend-development\u002F10.graceful-shutdown","i-lucide-power",{"title":200,"path":201,"stem":202,"icon":203},"Production Checklist","\u002Fbackend-development\u002Fproduction-checklist","5.backend-development\u002F11.production-checklist","i-lucide-clipboard-check",{"title":205,"path":206,"stem":207,"icon":208},"HTTP API Design","\u002Fbackend-development\u002Fhttp-api-design","5.backend-development\u002F2.http-api-design","i-lucide-waypoints",{"title":210,"path":211,"stem":212,"icon":213},"Middleware","\u002Fbackend-development\u002Fmiddleware","5.backend-development\u002F3.middleware","i-lucide-layers-3",{"title":215,"path":216,"stem":217,"icon":218},"Validation","\u002Fbackend-development\u002Fvalidation","5.backend-development\u002F4.validation","i-lucide-list-checks",{"title":220,"path":221,"stem":222,"icon":223},"Application Wiring","\u002Fbackend-development\u002Fapplication-wiring","5.backend-development\u002F5.application-wiring","i-lucide-cable",{"title":225,"path":226,"stem":227,"icon":228},"Observability","\u002Fbackend-development\u002Fobservability","5.backend-development\u002F6.observability","i-lucide-activity",{"title":230,"path":231,"stem":232,"icon":233},"Database SQL","\u002Fbackend-development\u002Fdatabase-sql","5.backend-development\u002F7.database-sql","i-lucide-database",{"title":235,"path":236,"stem":237,"icon":238},"Transactions","\u002Fbackend-development\u002Ftransactions","5.backend-development\u002F8.transactions","i-lucide-repeat-2",{"title":240,"path":241,"stem":242,"icon":243},"Authentication and Authorization","\u002Fbackend-development\u002Fauthentication","5.backend-development\u002F9.authentication","i-lucide-shield-check",{"title":245,"path":246,"stem":247,"children":248,"page":6},"Advanced Go","\u002Fadvanced-go","6.advanced-go",[249,254,259,264,269,274,278,283,288],{"title":250,"path":251,"stem":252,"icon":253},"Advanced Go Roadmap","\u002Fadvanced-go\u002Fadvanced-roadmap","6.advanced-go\u002F1.advanced-roadmap","i-lucide-brain-circuit",{"title":255,"path":256,"stem":257,"icon":258},"Reflection","\u002Fadvanced-go\u002Freflection","6.advanced-go\u002F2.reflection","i-lucide-scan-search",{"title":260,"path":261,"stem":262,"icon":263},"Memory and Garbage Collection","\u002Fadvanced-go\u002Fmemory-and-garbage-collection","6.advanced-go\u002F3.memory-and-garbage-collection","i-lucide-memory-stick",{"title":265,"path":266,"stem":267,"icon":268},"Benchmarking and Profiling","\u002Fadvanced-go\u002Fbenchmarking-and-profiling","6.advanced-go\u002F4.benchmarking-and-profiling","i-lucide-gauge",{"title":270,"path":271,"stem":272,"icon":273},"Advanced Testing and Fuzzing","\u002Fadvanced-go\u002Fadvanced-testing-and-fuzzing","6.advanced-go\u002F5.advanced-testing-and-fuzzing","i-lucide-microscope",{"title":275,"path":276,"stem":277,"icon":48},"Advanced Concurrency","\u002Fadvanced-go\u002Fadvanced-concurrency","6.advanced-go\u002F6.advanced-concurrency",{"title":279,"path":280,"stem":281,"icon":282},"Unsafe and C Boundaries","\u002Fadvanced-go\u002Funsafe-and-cgo","6.advanced-go\u002F7.unsafe-and-cgo","i-lucide-radiation",{"title":284,"path":285,"stem":286,"icon":287},"Package and API Design","\u002Fadvanced-go\u002Fpackage-and-api-design","6.advanced-go\u002F8.package-and-api-design","i-lucide-boxes",{"title":289,"path":290,"stem":291,"icon":292},"Distributed Reliability","\u002Fadvanced-go\u002Fdistributed-reliability","6.advanced-go\u002F9.distributed-reliability","i-lucide-cloud-cog",{"title":294,"path":295,"stem":296,"children":297,"page":6},"Projects","\u002Fprojects","7.projects",[298,316,332,347],{"title":299,"path":300,"stem":301,"children":302,"icon":305},"CLI Task Manager","\u002Fprojects\u002Fcli-task-manager","7.projects\u002F1.cli-task-manager\u002Findex",[303,306,311],{"title":304,"path":300,"stem":301,"icon":305},"Project — CLI Task Manager","i-lucide-list-todo",{"title":307,"path":308,"stem":309,"icon":310},"CLI — Domain and Storage","\u002Fprojects\u002Fcli-task-manager\u002Fdomain-and-storage","7.projects\u002F1.cli-task-manager\u002F1.domain-and-storage","i-lucide-save",{"title":312,"path":313,"stem":314,"icon":315},"CLI — Commands and Tests","\u002Fprojects\u002Fcli-task-manager\u002Fcommands-and-tests","7.projects\u002F1.cli-task-manager\u002F2.commands-and-tests","i-lucide-terminal",{"title":317,"path":318,"stem":319,"children":320,"icon":323},"Concurrent URL Checker","\u002Fprojects\u002Fconcurrent-url-checker","7.projects\u002F2.concurrent-url-checker\u002Findex",[321,324,328],{"title":322,"path":318,"stem":319,"icon":323},"Project — Concurrent URL Checker","i-lucide-radar",{"title":325,"path":326,"stem":327,"icon":128},"URL Checker — Worker Pipeline","\u002Fprojects\u002Fconcurrent-url-checker\u002Fworker-pipeline","7.projects\u002F2.concurrent-url-checker\u002F1.worker-pipeline",{"title":329,"path":330,"stem":331,"icon":173},"URL Checker — Cancellation and Tests","\u002Fprojects\u002Fconcurrent-url-checker\u002Fcancellation-and-tests","7.projects\u002F2.concurrent-url-checker\u002F2.cancellation-and-tests",{"title":333,"path":334,"stem":335,"children":336},"File-backed API","\u002Fprojects\u002Ffile-backed-api","7.projects\u002F3.file-backed-api\u002Findex",[337,339,343],{"title":338,"path":334,"stem":335},"File-backed notes API",{"title":340,"path":341,"stem":342},"File store and concurrency","\u002Fprojects\u002Ffile-backed-api\u002Ffile-store-and-concurrency","7.projects\u002F3.file-backed-api\u002F1.file-store-and-concurrency",{"title":344,"path":345,"stem":346},"HTTP layer and tests","\u002Fprojects\u002Ffile-backed-api\u002Fhttp-and-tests","7.projects\u002F3.file-backed-api\u002F2.http-and-tests",{"title":348,"path":349,"stem":350,"children":351},"Production REST API","\u002Fprojects\u002Fproduction-rest-api","7.projects\u002F4.production-rest-api\u002Findex",[352,354,358],{"title":353,"path":349,"stem":350},"Production REST API capstone",{"title":355,"path":356,"stem":357},"Persistence and authentication","\u002Fprojects\u002Fproduction-rest-api\u002Fpersistence-and-auth","7.projects\u002F4.production-rest-api\u002F1.persistence-and-auth",{"title":359,"path":360,"stem":361},"Operations and release","\u002Fprojects\u002Fproduction-rest-api\u002Foperations-and-release","7.projects\u002F4.production-rest-api\u002F2.operations-and-release",{"title":363,"path":364,"stem":365,"children":366,"page":6},"Meta","\u002Fmeta","99.meta",[367,372],{"title":368,"path":369,"stem":370,"icon":371},"About","\u002Fmeta\u002Fabout","99.meta\u002F1.about","i-lucide-info",{"title":373,"path":374,"stem":375,"icon":376},"Acknowledgements","\u002Fmeta\u002Facknowledgements","99.meta\u002F2.acknowledgements","i-lucide-heart-handshake",{"id":378,"title":150,"body":379,"description":953,"extension":954,"links":955,"meta":956,"navigation":957,"path":151,"seo":958,"stem":152,"__hash__":960},"docs\u002F4.standard-library\u002F1.overview.md",{"type":380,"value":381,"toc":943},"minimark",[382,389,394,407,411,414,418,574,578,613,627,631,634,660,663,755,758,762,780,784,787,873,876,881,885,896,917,921,932,935,939],[383,384],"learning-lesson-meta",{"description":385,"difficulty":386,"prerequisites":387,"time":388},"Build clear understanding through explanation, examples, and practice.","Beginner","Core Go syntax","20 minutes",[390,391,393],"h2",{"id":392},"what-you-will-learn","What you will learn",[395,396,397,401,404],"ul",{},[398,399,400],"li",{},"find the standard packages used most often;",[398,402,403],{},"read package APIs through their interfaces and examples;",[398,405,406],{},"track resource ownership;",[408,409,410],"p",{},"Go's standard library is the set of packages shipped with the language. It covers text, files, JSON, HTTP, cryptography, testing, concurrency, and many other everyday needs.",[408,412,413],{},"Learning it does not mean memorising every package. Learn the common building blocks and practise finding the rest.",[390,415,417],{"id":416},"packages-to-learn-first","Packages to learn first",[419,420,421,434],"table",{},[422,423,424],"thead",{},[425,426,427,431],"tr",{},[428,429,430],"th",{},"Problem",[428,432,433],{},"Useful packages",[435,436,437,449,469,485,495,505,515,525,535,551,564],"tbody",{},[425,438,439,443],{},[440,441,442],"td",{},"Print and format values",[440,444,445],{},[446,447,448],"code",{},"fmt",[425,450,451,454],{},[440,452,453],{},"Work with text",[440,455,456,459,460,459,463,459,466],{},[446,457,458],{},"strings",", ",[446,461,462],{},"strconv",[446,464,465],{},"unicode",[446,467,468],{},"regexp",[425,470,471,474],{},[440,472,473],{},"Read and write data",[440,475,476,459,479,459,482],{},[446,477,478],{},"io",[446,480,481],{},"os",[446,483,484],{},"bufio",[425,486,487,490],{},[440,488,489],{},"Encode structured data",[440,491,492],{},[446,493,494],{},"encoding\u002Fjson",[425,496,497,500],{},[440,498,499],{},"Build HTTP clients and servers",[440,501,502],{},[446,503,504],{},"net\u002Fhttp",[425,506,507,510],{},[440,508,509],{},"Work with time",[440,511,512],{},[446,513,514],{},"time",[425,516,517,520],{},[440,518,519],{},"Carry cancellation and deadlines",[440,521,522],{},[446,523,524],{},"context",[425,526,527,530],{},[440,528,529],{},"Create and inspect errors",[440,531,532],{},[446,533,534],{},"errors",[425,536,537,540],{},[440,538,539],{},"Sort and search",[440,541,542,459,545,459,548],{},[446,543,544],{},"sort",[446,546,547],{},"slices",[446,549,550],{},"maps",[425,552,553,556],{},[440,554,555],{},"Test code",[440,557,558,459,561],{},[446,559,560],{},"testing",[446,562,563],{},"httptest",[425,565,566,569],{},[440,567,568],{},"Log structured events",[440,570,571],{},[446,572,573],{},"log\u002Fslog",[390,575,577],{"id":576},"read-documentation-locally","Read documentation locally",[579,580,585],"pre",{"className":581,"code":582,"language":583,"meta":584,"style":584},"language-bash shiki shiki-themes solarized-light material-theme one-dark-pro","go doc strings\ngo doc strings.Contains\n","bash","",[446,586,587,603],{"__ignoreMap":584},[588,589,592,596,600],"span",{"class":590,"line":591},"line",1,[588,593,595],{"class":594},"sqRHY","go",[588,597,599],{"class":598},"sVazx"," doc",[588,601,602],{"class":598}," strings\n",[588,604,606,608,610],{"class":590,"line":605},2,[588,607,595],{"class":594},[588,609,599],{"class":598},[588,611,612],{"class":598}," strings.Contains\n",[408,614,615,618,619,626],{},[446,616,617],{},"go doc"," works directly from the terminal. The online package index at ",[620,621,625],"a",{"href":622,"rel":623},"https:\u002F\u002Fpkg.go.dev\u002Fstd",[624],"nofollow","pkg.go.dev\u002Fstd"," provides the same API documentation with search and links.",[390,628,630],{"id":629},"learn-interfaces-not-just-functions","Learn interfaces, not just functions",[408,632,633],{},"Many packages connect through small interfaces:",[395,635,636,642,648,654],{},[398,637,638,641],{},[446,639,640],{},"io.Reader"," produces bytes;",[398,643,644,647],{},[446,645,646],{},"io.Writer"," consumes bytes;",[398,649,650,653],{},[446,651,652],{},"error"," describes failure;",[398,655,656,659],{},[446,657,658],{},"context.Context"," communicates cancellation and deadlines.",[408,661,662],{},"A file, HTTP response body, compressed stream, and in-memory buffer can all be readers. Once you understand the interface, many packages begin to fit together.",[579,664,667],{"className":665,"code":666,"language":595,"meta":584,"style":584},"language-go shiki shiki-themes solarized-light material-theme one-dark-pro","func countBytes(r io.Reader) (int64, error) {\n    return io.Copy(io.Discard, r)\n}\n",[446,668,669,718,749],{"__ignoreMap":584},[588,670,671,675,679,683,687,691,694,697,700,703,707,710,713,715],{"class":590,"line":591},[588,672,674],{"class":673},"sEOdo","func",[588,676,678],{"class":677},"sisdC"," countBytes",[588,680,682],{"class":681},"shFME","(",[588,684,686],{"class":685},"syre3","r",[588,688,690],{"class":689},"snwKR"," io",[588,692,693],{"class":681},".",[588,695,696],{"class":689},"Reader",[588,698,699],{"class":681},")",[588,701,702],{"class":681}," (",[588,704,706],{"class":705},"sF6sA","int64",[588,708,709],{"class":681},",",[588,711,712],{"class":705}," error",[588,714,699],{"class":681},[588,716,717],{"class":681}," {\n",[588,719,720,724,727,729,732,734,736,738,741,743,746],{"class":590,"line":605},[588,721,723],{"class":722},"s7Bcg","    return",[588,725,690],{"class":726},"s45-6",[588,728,693],{"class":681},[588,730,731],{"class":677},"Copy",[588,733,682],{"class":681},[588,735,478],{"class":726},[588,737,693],{"class":681},[588,739,740],{"class":726},"Discard",[588,742,709],{"class":681},[588,744,745],{"class":726}," r",[588,747,748],{"class":681},")\n",[588,750,752],{"class":590,"line":751},3,[588,753,754],{"class":681},"}\n",[408,756,757],{},"This function does not care where the bytes come from.",[390,759,761],{"id":760},"a-method-for-learning-a-package","A method for learning a package",[763,764,765,768,771,774,777],"ol",{},[398,766,767],{},"Read the package overview.",[398,769,770],{},"Find the main types and interfaces.",[398,772,773],{},"Read one or two examples.",[398,775,776],{},"Write the smallest useful program with the package.",[398,778,779],{},"Check how errors, resource cleanup, and cancellation work.",[390,781,783],{"id":782},"resource-ownership","Resource ownership",[408,785,786],{},"Many standard-library values hold operating-system resources. When a function successfully opens a file, response body, or connection, the caller usually must close it.",[579,788,790],{"className":665,"code":789,"language":595,"meta":584,"style":584},"file, err := os.Open(\"notes.txt\")\nif err != nil {\n    return err\n}\ndefer file.Close()\n",[446,791,792,827,844,851,856],{"__ignoreMap":584},[588,793,794,797,799,802,806,809,811,814,816,820,823,825],{"class":590,"line":591},[588,795,796],{"class":726},"file",[588,798,709],{"class":681},[588,800,801],{"class":726}," err",[588,803,805],{"class":804},"su2KV"," :=",[588,807,808],{"class":726}," os",[588,810,693],{"class":681},[588,812,813],{"class":677},"Open",[588,815,682],{"class":681},[588,817,819],{"class":818},"sED5a","\"",[588,821,822],{"class":598},"notes.txt",[588,824,819],{"class":818},[588,826,748],{"class":681},[588,828,829,832,834,838,842],{"class":590,"line":605},[588,830,831],{"class":722},"if",[588,833,801],{"class":726},[588,835,837],{"class":836},"sRBoR"," !=",[588,839,841],{"class":840},"sp8Z5"," nil",[588,843,717],{"class":681},[588,845,846,848],{"class":590,"line":751},[588,847,723],{"class":722},[588,849,850],{"class":726}," err\n",[588,852,854],{"class":590,"line":853},4,[588,855,754],{"class":681},[588,857,859,862,865,867,870],{"class":590,"line":858},5,[588,860,861],{"class":722},"defer",[588,863,864],{"class":726}," file",[588,866,693],{"class":681},[588,868,869],{"class":677},"Close",[588,871,872],{"class":681},"()\n",[408,874,875],{},"Always read the documentation to learn who owns a resource and when it must be released.",[408,877,878,879,693],{},"Next: ",[620,880,155],{"href":156},[390,882,884],{"id":883},"practice","Practice",[408,886,887,888,459,890,892,893,895],{},"Choose ",[446,889,481],{},[446,891,478],{},", or ",[446,894,504],{},". Identify one resource the caller must close and one error it must handle.",[897,898,899],"accordion",{},[900,901,904,905,908,909,912,913,916],"accordion-item",{"icon":902,"label":903},"i-lucide-lightbulb","Show solution","For ",[446,906,907],{},"os.Open",", the caller handles the returned error and closes the returned file, commonly with ",[446,910,911],{},"defer file.Close()"," after the error check. For an HTTP client response, the caller closes ",[446,914,915],{},"response.Body"," after a successful request.",[390,918,920],{"id":919},"summary","Summary",[395,922,923,926,929],{},[398,924,925],{},"Prefer the standard library when it clearly meets the requirement.",[398,927,928],{},"Learn package contracts, ownership, and errors—not isolated function names.",[398,930,931],{},"Documentation examples become useful experiments when you change and test them.",[933,934],"learning-lesson-complete",{},[936,937],"learning-lesson-navigation",{"next":156,"nextTitle":938,"previous":141,"previousTitle":140},"Text and formatting",[940,941,942],"style",{},"html pre.shiki code .sqRHY, html code.shiki .sqRHY{--shiki-light:#268BD2;--shiki-default:#FFCB6B;--shiki-dark:#61AFEF}html pre.shiki code .sVazx, html code.shiki .sVazx{--shiki-light:#2AA198;--shiki-default:#C3E88D;--shiki-dark:#98C379}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sEOdo, html code.shiki .sEOdo{--shiki-light:#859900;--shiki-default:#89DDFF;--shiki-dark:#C678DD}html pre.shiki code .sisdC, html code.shiki .sisdC{--shiki-light:#268BD2;--shiki-default:#82AAFF;--shiki-dark:#61AFEF}html pre.shiki code .shFME, html code.shiki .shFME{--shiki-light:#657B83;--shiki-default:#89DDFF;--shiki-dark:#ABB2BF}html pre.shiki code .syre3, html code.shiki .syre3{--shiki-light:#657B83;--shiki-light-font-style:inherit;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#E06C75;--shiki-dark-font-style:italic}html pre.shiki code .snwKR, html code.shiki .snwKR{--shiki-light:#CB4B16;--shiki-default:#FFCB6B;--shiki-dark:#E5C07B}html pre.shiki code .sF6sA, html code.shiki .sF6sA{--shiki-light:#586E75;--shiki-light-font-weight:bold;--shiki-default:#C792EA;--shiki-default-font-weight:inherit;--shiki-dark:#C678DD;--shiki-dark-font-weight:inherit}html pre.shiki code .s7Bcg, html code.shiki .s7Bcg{--shiki-light:#859900;--shiki-light-font-style:inherit;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#C678DD;--shiki-dark-font-style:inherit}html pre.shiki code .s45-6, html code.shiki .s45-6{--shiki-light:#268BD2;--shiki-default:#EEFFFF;--shiki-dark:#E06C75}html pre.shiki code .su2KV, html code.shiki .su2KV{--shiki-light:#859900;--shiki-default:#89DDFF;--shiki-dark:#E5C07B}html pre.shiki code .sED5a, html code.shiki .sED5a{--shiki-light:#2AA198;--shiki-default:#89DDFF;--shiki-dark:#98C379}html pre.shiki code .sRBoR, html code.shiki .sRBoR{--shiki-light:#859900;--shiki-default:#89DDFF;--shiki-dark:#56B6C2}html pre.shiki code .sp8Z5, html code.shiki .sp8Z5{--shiki-light:#B58900;--shiki-default:#89DDFF;--shiki-dark:#D19A66}",{"title":584,"searchDepth":605,"depth":605,"links":944},[945,946,947,948,949,950,951,952],{"id":392,"depth":605,"text":393},{"id":416,"depth":605,"text":417},{"id":576,"depth":605,"text":577},{"id":629,"depth":605,"text":630},{"id":760,"depth":605,"text":761},{"id":782,"depth":605,"text":783},{"id":883,"depth":605,"text":884},{"id":919,"depth":605,"text":920},"Learn how to discover and combine Go's built-in packages to solve real problems.","md",null,{},{"icon":153},{"description":959,"title":150},"A guided map of the Go standard library for beginners building command-line tools, services, and tests.","WkqDboZDODpmbqmbwDiqpSP4Fc4LVj6mmZfrkXp6nmU",[962,964],{"title":140,"path":141,"stem":142,"description":963,"icon":143,"children":-1},"Coordinate goroutines safely with WaitGroup, Mutex, RWMutex, Once, and atomic operations.",{"title":155,"path":156,"stem":157,"description":965,"icon":158,"children":-1},"Format output, manipulate strings, convert values, and handle Unicode correctly.",1794118092726]