[{"data":1,"prerenderedAt":1348},["ShallowReactive",2],{"navigation_docs":3,"-standard-library-text-and-formatting":377,"-standard-library-text-and-formatting-surround":1343},[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":155,"body":379,"description":1335,"extension":1336,"links":1337,"meta":1338,"navigation":1339,"path":156,"seo":1340,"stem":157,"__hash__":1342},"docs\u002F4.standard-library\u002F2.text-and-formatting.md",{"type":380,"value":381,"toc":1322},"minimark",[382,389,394,415,423,429,596,613,616,703,709,849,852,919,926,933,1077,1083,1087,1093,1163,1174,1242,1249,1253,1263,1267,1277,1293,1297,1311,1314,1318],[383,384],"learning-lesson-meta",{"description":385,"difficulty":386,"prerequisites":387,"time":388},"Build clear understanding through explanation, examples, and practice.","Beginner","Variables, slices, and loops","30 minutes",[390,391,393],"h2",{"id":392},"what-you-will-learn","What you will learn",[395,396,397,406,412],"ul",{},[398,399,400,401,405],"li",{},"format values with ",[402,403,404],"code",{},"fmt",";",[398,407,408,409,405],{},"search and transform text with ",[402,410,411],{},"strings",[398,413,414],{},"distinguish bytes from Unicode code points;",[416,417,418,419,422],"p",{},"Text in Go is usually stored in a ",[402,420,421],{},"string",". A string is a read-only sequence of bytes, commonly containing UTF-8 text.",[390,424,426,427],{"id":425},"print-with-fmt","Print with ",[402,428,404],{},[430,431,436],"pre",{"className":432,"code":433,"language":434,"meta":435,"style":435},"language-go shiki shiki-themes solarized-light material-theme one-dark-pro","name := \"Mira\"\nlessons := 12\n\nfmt.Println(\"Learner:\", name)\nfmt.Printf(\"%s completed %d lessons\\n\", name, lessons)\nmessage := fmt.Sprintf(\"%s: %d\", name, lessons)\n","go","",[402,437,438,462,474,481,514,557],{"__ignoreMap":435},[439,440,443,447,451,455,459],"span",{"class":441,"line":442},"line",1,[439,444,446],{"class":445},"s45-6","name",[439,448,450],{"class":449},"su2KV"," :=",[439,452,454],{"class":453},"sED5a"," \"",[439,456,458],{"class":457},"sVazx","Mira",[439,460,461],{"class":453},"\"\n",[439,463,465,468,470],{"class":441,"line":464},2,[439,466,467],{"class":445},"lessons",[439,469,450],{"class":449},[439,471,473],{"class":472},"sAJzr"," 12\n",[439,475,477],{"class":441,"line":476},3,[439,478,480],{"emptyLinePlaceholder":479},true,"\n",[439,482,484,486,490,494,497,500,503,505,508,511],{"class":441,"line":483},4,[439,485,404],{"class":445},[439,487,489],{"class":488},"shFME",".",[439,491,493],{"class":492},"sisdC","Println",[439,495,496],{"class":488},"(",[439,498,499],{"class":453},"\"",[439,501,502],{"class":457},"Learner:",[439,504,499],{"class":453},[439,506,507],{"class":488},",",[439,509,510],{"class":445}," name",[439,512,513],{"class":488},")\n",[439,515,517,519,521,524,526,528,532,535,538,541,545,547,549,551,553,555],{"class":441,"line":516},5,[439,518,404],{"class":445},[439,520,489],{"class":488},[439,522,523],{"class":492},"Printf",[439,525,496],{"class":488},[439,527,499],{"class":453},[439,529,531],{"class":530},"st3jj","%s",[439,533,534],{"class":457}," completed ",[439,536,537],{"class":530},"%d",[439,539,540],{"class":457}," lessons",[439,542,544],{"class":543},"sk51v","\\n",[439,546,499],{"class":453},[439,548,507],{"class":488},[439,550,510],{"class":445},[439,552,507],{"class":488},[439,554,540],{"class":445},[439,556,513],{"class":488},[439,558,560,563,565,568,570,573,575,577,579,582,584,586,588,590,592,594],{"class":441,"line":559},6,[439,561,562],{"class":445},"message",[439,564,450],{"class":449},[439,566,567],{"class":445}," fmt",[439,569,489],{"class":488},[439,571,572],{"class":492},"Sprintf",[439,574,496],{"class":488},[439,576,499],{"class":453},[439,578,531],{"class":530},[439,580,581],{"class":457},": ",[439,583,537],{"class":530},[439,585,499],{"class":453},[439,587,507],{"class":488},[439,589,510],{"class":445},[439,591,507],{"class":488},[439,593,540],{"class":445},[439,595,513],{"class":488},[395,597,598,603,608],{},[398,599,600,602],{},[402,601,493],{}," separates values with spaces and adds a newline.",[398,604,605,607],{},[402,606,523],{}," writes according to a format string.",[398,609,610,612],{},[402,611,572],{}," returns the formatted string instead of printing it.",[416,614,615],{},"Useful verbs include:",[617,618,619,632],"table",{},[620,621,622],"thead",{},[623,624,625,629],"tr",{},[626,627,628],"th",{},"Verb",[626,630,631],{},"Meaning",[633,634,635,644,653,663,673,683,693],"tbody",{},[623,636,637,642],{},[638,639,640],"td",{},[402,641,531],{},[638,643,421],{},[623,645,646,650],{},[638,647,648],{},[402,649,537],{},[638,651,652],{},"decimal integer",[623,654,655,660],{},[638,656,657],{},[402,658,659],{},"%f",[638,661,662],{},"floating-point number",[623,664,665,670],{},[638,666,667],{},[402,668,669],{},"%t",[638,671,672],{},"boolean",[623,674,675,680],{},[638,676,677],{},[402,678,679],{},"%v",[638,681,682],{},"default value representation",[623,684,685,690],{},[638,686,687],{},[402,688,689],{},"%T",[638,691,692],{},"Go type",[623,694,695,700],{},[638,696,697],{},[402,698,699],{},"%q",[638,701,702],{},"quoted string or character",[390,704,706,707],{"id":705},"search-and-transform-with-strings","Search and transform with ",[402,708,411],{},[430,710,712],{"className":432,"code":711,"language":434,"meta":435,"style":435},"title := \"  Learning Go  \"\ntitle = strings.TrimSpace(title)\n\nfmt.Println(strings.ToUpper(title))\nfmt.Println(strings.Contains(title, \"Go\"))\nfmt.Println(strings.ReplaceAll(title, \"Go\", \"Golang\"))\n",[402,713,714,728,749,753,777,809],{"__ignoreMap":435},[439,715,716,719,721,723,726],{"class":441,"line":442},[439,717,718],{"class":445},"title",[439,720,450],{"class":449},[439,722,454],{"class":453},[439,724,725],{"class":457},"  Learning Go  ",[439,727,461],{"class":453},[439,729,730,732,735,738,740,743,745,747],{"class":441,"line":464},[439,731,718],{"class":445},[439,733,734],{"class":449}," =",[439,736,737],{"class":445}," strings",[439,739,489],{"class":488},[439,741,742],{"class":492},"TrimSpace",[439,744,496],{"class":488},[439,746,718],{"class":445},[439,748,513],{"class":488},[439,750,751],{"class":441,"line":476},[439,752,480],{"emptyLinePlaceholder":479},[439,754,755,757,759,761,763,765,767,770,772,774],{"class":441,"line":483},[439,756,404],{"class":445},[439,758,489],{"class":488},[439,760,493],{"class":492},[439,762,496],{"class":488},[439,764,411],{"class":445},[439,766,489],{"class":488},[439,768,769],{"class":492},"ToUpper",[439,771,496],{"class":488},[439,773,718],{"class":445},[439,775,776],{"class":488},"))\n",[439,778,779,781,783,785,787,789,791,794,796,798,800,802,805,807],{"class":441,"line":516},[439,780,404],{"class":445},[439,782,489],{"class":488},[439,784,493],{"class":492},[439,786,496],{"class":488},[439,788,411],{"class":445},[439,790,489],{"class":488},[439,792,793],{"class":492},"Contains",[439,795,496],{"class":488},[439,797,718],{"class":445},[439,799,507],{"class":488},[439,801,454],{"class":453},[439,803,804],{"class":457},"Go",[439,806,499],{"class":453},[439,808,776],{"class":488},[439,810,811,813,815,817,819,821,823,826,828,830,832,834,836,838,840,842,845,847],{"class":441,"line":559},[439,812,404],{"class":445},[439,814,489],{"class":488},[439,816,493],{"class":492},[439,818,496],{"class":488},[439,820,411],{"class":445},[439,822,489],{"class":488},[439,824,825],{"class":492},"ReplaceAll",[439,827,496],{"class":488},[439,829,718],{"class":445},[439,831,507],{"class":488},[439,833,454],{"class":453},[439,835,804],{"class":457},[439,837,499],{"class":453},[439,839,507],{"class":488},[439,841,454],{"class":453},[439,843,844],{"class":457},"Golang",[439,846,499],{"class":453},[439,848,776],{"class":488},[416,850,851],{},"Split and join structured text:",[430,853,855],{"className":432,"code":854,"language":434,"meta":435,"style":435},"parts := strings.Split(\"api,worker,cli\", \",\")\njoined := strings.Join(parts, \" | \")\n",[402,856,857,890],{"__ignoreMap":435},[439,858,859,862,864,866,868,871,873,875,878,880,882,884,886,888],{"class":441,"line":442},[439,860,861],{"class":445},"parts",[439,863,450],{"class":449},[439,865,737],{"class":445},[439,867,489],{"class":488},[439,869,870],{"class":492},"Split",[439,872,496],{"class":488},[439,874,499],{"class":453},[439,876,877],{"class":457},"api,worker,cli",[439,879,499],{"class":453},[439,881,507],{"class":488},[439,883,454],{"class":453},[439,885,507],{"class":457},[439,887,499],{"class":453},[439,889,513],{"class":488},[439,891,892,895,897,899,901,904,906,908,910,912,915,917],{"class":441,"line":464},[439,893,894],{"class":445},"joined",[439,896,450],{"class":449},[439,898,737],{"class":445},[439,900,489],{"class":488},[439,902,903],{"class":492},"Join",[439,905,496],{"class":488},[439,907,861],{"class":445},[439,909,507],{"class":488},[439,911,454],{"class":453},[439,913,914],{"class":457}," | ",[439,916,499],{"class":453},[439,918,513],{"class":488},[416,920,921,922,925],{},"Use ",[402,923,924],{},"strings.Builder"," when repeatedly constructing a large string in a loop.",[390,927,929,930],{"id":928},"convert-with-strconv","Convert with ",[402,931,932],{},"strconv",[430,934,936],{"className":432,"code":935,"language":434,"meta":435,"style":435},"port, err := strconv.Atoi(\"8080\")\nif err != nil {\n    return fmt.Errorf(\"parse port: %w\", err)\n}\n\ntext := strconv.Itoa(port)\nenabled, err := strconv.ParseBool(\"true\")\n",[402,937,938,969,988,1018,1023,1027,1047],{"__ignoreMap":435},[439,939,940,943,945,948,950,953,955,958,960,962,965,967],{"class":441,"line":442},[439,941,942],{"class":445},"port",[439,944,507],{"class":488},[439,946,947],{"class":445}," err",[439,949,450],{"class":449},[439,951,952],{"class":445}," strconv",[439,954,489],{"class":488},[439,956,957],{"class":492},"Atoi",[439,959,496],{"class":488},[439,961,499],{"class":453},[439,963,964],{"class":457},"8080",[439,966,499],{"class":453},[439,968,513],{"class":488},[439,970,971,975,977,981,985],{"class":441,"line":464},[439,972,974],{"class":973},"s7Bcg","if",[439,976,947],{"class":445},[439,978,980],{"class":979},"sRBoR"," !=",[439,982,984],{"class":983},"sp8Z5"," nil",[439,986,987],{"class":488}," {\n",[439,989,990,993,995,997,1000,1002,1004,1007,1010,1012,1014,1016],{"class":441,"line":476},[439,991,992],{"class":973},"    return",[439,994,567],{"class":445},[439,996,489],{"class":488},[439,998,999],{"class":492},"Errorf",[439,1001,496],{"class":488},[439,1003,499],{"class":453},[439,1005,1006],{"class":457},"parse port: ",[439,1008,1009],{"class":530},"%w",[439,1011,499],{"class":453},[439,1013,507],{"class":488},[439,1015,947],{"class":445},[439,1017,513],{"class":488},[439,1019,1020],{"class":441,"line":483},[439,1021,1022],{"class":488},"}\n",[439,1024,1025],{"class":441,"line":516},[439,1026,480],{"emptyLinePlaceholder":479},[439,1028,1029,1032,1034,1036,1038,1041,1043,1045],{"class":441,"line":559},[439,1030,1031],{"class":445},"text",[439,1033,450],{"class":449},[439,1035,952],{"class":445},[439,1037,489],{"class":488},[439,1039,1040],{"class":492},"Itoa",[439,1042,496],{"class":488},[439,1044,942],{"class":445},[439,1046,513],{"class":488},[439,1048,1050,1053,1055,1057,1059,1061,1063,1066,1068,1070,1073,1075],{"class":441,"line":1049},7,[439,1051,1052],{"class":445},"enabled",[439,1054,507],{"class":488},[439,1056,947],{"class":445},[439,1058,450],{"class":449},[439,1060,952],{"class":445},[439,1062,489],{"class":488},[439,1064,1065],{"class":492},"ParseBool",[439,1067,496],{"class":488},[439,1069,499],{"class":453},[439,1071,1072],{"class":457},"true",[439,1074,499],{"class":453},[439,1076,513],{"class":488},[416,1078,1079,1080,1082],{},"Parsing can fail, so handle the error. Formatting a known value with functions such as ",[402,1081,1040],{}," does not fail.",[390,1084,1086],{"id":1085},"bytes-runes-and-characters","Bytes, runes, and characters",[416,1088,1089,1092],{},[402,1090,1091],{},"len(text)"," counts bytes, not human-visible characters.",[430,1094,1096],{"className":432,"code":1095,"language":434,"meta":435,"style":435},"word := \"Go世界\"\nfmt.Println(len(word))                    \u002F\u002F bytes\nfmt.Println(utf8.RuneCountInString(word)) \u002F\u002F Unicode code points\n",[402,1097,1098,1112,1136],{"__ignoreMap":435},[439,1099,1100,1103,1105,1107,1110],{"class":441,"line":442},[439,1101,1102],{"class":445},"word",[439,1104,450],{"class":449},[439,1106,454],{"class":453},[439,1108,1109],{"class":457},"Go世界",[439,1111,461],{"class":453},[439,1113,1114,1116,1118,1120,1122,1125,1127,1129,1132],{"class":441,"line":464},[439,1115,404],{"class":445},[439,1117,489],{"class":488},[439,1119,493],{"class":492},[439,1121,496],{"class":488},[439,1123,1124],{"class":492},"len",[439,1126,496],{"class":488},[439,1128,1102],{"class":445},[439,1130,1131],{"class":488},"))",[439,1133,1135],{"class":1134},"sJsHy","                    \u002F\u002F bytes\n",[439,1137,1138,1140,1142,1144,1146,1149,1151,1154,1156,1158,1160],{"class":441,"line":476},[439,1139,404],{"class":445},[439,1141,489],{"class":488},[439,1143,493],{"class":492},[439,1145,496],{"class":488},[439,1147,1148],{"class":445},"utf8",[439,1150,489],{"class":488},[439,1152,1153],{"class":492},"RuneCountInString",[439,1155,496],{"class":488},[439,1157,1102],{"class":445},[439,1159,1131],{"class":488},[439,1161,1162],{"class":1134}," \u002F\u002F Unicode code points\n",[416,1164,1165,1166,1169,1170,1173],{},"A ",[402,1167,1168],{},"rune"," is an alias for ",[402,1171,1172],{},"int32"," and represents one Unicode code point.",[430,1175,1177],{"className":432,"code":1176,"language":434,"meta":435,"style":435},"for index, r := range word {\n    fmt.Printf(\"byte index %d: %q\\n\", index, r)\n}\n",[402,1178,1179,1202,1238],{"__ignoreMap":435},[439,1180,1181,1184,1187,1189,1192,1194,1197,1200],{"class":441,"line":442},[439,1182,1183],{"class":973},"for",[439,1185,1186],{"class":445}," index",[439,1188,507],{"class":488},[439,1190,1191],{"class":445}," r",[439,1193,450],{"class":449},[439,1195,1196],{"class":973}," range",[439,1198,1199],{"class":445}," word",[439,1201,987],{"class":488},[439,1203,1204,1207,1209,1211,1213,1215,1218,1220,1222,1224,1226,1228,1230,1232,1234,1236],{"class":441,"line":464},[439,1205,1206],{"class":445},"    fmt",[439,1208,489],{"class":488},[439,1210,523],{"class":492},[439,1212,496],{"class":488},[439,1214,499],{"class":453},[439,1216,1217],{"class":457},"byte index ",[439,1219,537],{"class":530},[439,1221,581],{"class":457},[439,1223,699],{"class":530},[439,1225,544],{"class":543},[439,1227,499],{"class":453},[439,1229,507],{"class":488},[439,1231,1186],{"class":445},[439,1233,507],{"class":488},[439,1235,1191],{"class":445},[439,1237,513],{"class":488},[439,1239,1240],{"class":441,"line":476},[439,1241,1022],{"class":488},[416,1243,1244,1245,1248],{},"The index from ranging over a string is a byte index. Convert to ",[402,1246,1247],{},"[]rune"," when you genuinely need to index code points, while remembering that one user-perceived character may contain several code points.",[390,1250,1252],{"id":1251},"strings-are-immutable","Strings are immutable",[416,1254,1255,1256,1259,1260,1262],{},"You cannot change a byte inside a string directly. Convert to ",[402,1257,1258],{},"[]byte"," for byte-level changes or ",[402,1261,1247],{}," for code-point-level changes, then convert back.",[390,1264,1266],{"id":1265},"practice","Practice",[416,1268,1269,1270,1273,1274,489],{},"Accept a comma-separated line such as ",[402,1271,1272],{},"alice, bob,CHARLIE",". Split it, trim spaces, normalise each name to title case using a simple first-letter rule, and join the names with ",[402,1275,1276],{},"|",[1278,1279,1280],"accordion",{},[1281,1282,1285,1286,1288,1289,1292],"accordion-item",{"icon":1283,"label":1284},"i-lucide-lightbulb","Show solution","Normalise the input with the exact policy the exercise requires, parse numeric text with ",[402,1287,932],{},", and return parsing errors rather than substituting zero. When iterating human-readable text, ",[402,1290,1291],{},"range"," yields rune positions and values; indexing yields bytes.",[390,1294,1296],{"id":1295},"summary","Summary",[395,1298,1299,1302,1308],{},[398,1300,1301],{},"Use formatting verbs that match the value and output purpose.",[398,1303,1304,1305,1307],{},"Strings are immutable byte sequences, while ",[402,1306,1291],{}," decodes UTF-8 runes.",[398,1309,1310],{},"Parsing is fallible and its errors belong in the program's control flow.",[1312,1313],"learning-lesson-complete",{},[1315,1316],"learning-lesson-navigation",{"next":161,"nextTitle":160,"previous":151,"previousTitle":1317},"Standard library overview",[1319,1320,1321],"style",{},"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 .sVazx, html code.shiki .sVazx{--shiki-light:#2AA198;--shiki-default:#C3E88D;--shiki-dark:#98C379}html pre.shiki code .sAJzr, html code.shiki .sAJzr{--shiki-light:#D33682;--shiki-default:#F78C6C;--shiki-dark:#D19A66}html pre.shiki code .shFME, html code.shiki .shFME{--shiki-light:#657B83;--shiki-default:#89DDFF;--shiki-dark:#ABB2BF}html pre.shiki code .sisdC, html code.shiki .sisdC{--shiki-light:#268BD2;--shiki-default:#82AAFF;--shiki-dark:#61AFEF}html pre.shiki code .st3jj, html code.shiki .st3jj{--shiki-light:#CB4B16;--shiki-default:#F07178;--shiki-dark:#D19A66}html pre.shiki code .sk51v, html code.shiki .sk51v{--shiki-light:#CB4B16;--shiki-default:#EEFFFF;--shiki-dark:#56B6C2}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 .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 .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}html pre.shiki code .sJsHy, html code.shiki .sJsHy{--shiki-light:#93A1A1;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic}",{"title":435,"searchDepth":464,"depth":464,"links":1323},[1324,1325,1327,1329,1331,1332,1333,1334],{"id":392,"depth":464,"text":393},{"id":425,"depth":464,"text":1326},"Print with fmt",{"id":705,"depth":464,"text":1328},"Search and transform with strings",{"id":928,"depth":464,"text":1330},"Convert with strconv",{"id":1085,"depth":464,"text":1086},{"id":1251,"depth":464,"text":1252},{"id":1265,"depth":464,"text":1266},{"id":1295,"depth":464,"text":1296},"Format output, manipulate strings, convert values, and handle Unicode correctly.","md",null,{},{"icon":158},{"description":1341,"title":155},"Learn fmt, strings, strconv, bytes, and Unicode basics in Go with practical examples.","c09bk9_zWStgWOlVU16GIfIy_ERSpoVMbicQ4Qc-pLg",[1344,1346],{"title":150,"path":151,"stem":152,"description":1345,"icon":153,"children":-1},"Learn how to discover and combine Go's built-in packages to solve real problems.",{"title":160,"path":161,"stem":162,"description":1347,"icon":163,"children":-1},"Read and write files, stream data, and encode structured values as JSON.",1794118100037]