[{"data":1,"prerenderedAt":1587},["ShallowReactive",2],{"navigation_docs":3,"-projects-concurrent-url-checker":377,"-projects-concurrent-url-checker-surround":1582},[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":322,"body":379,"description":1574,"extension":1575,"links":1576,"meta":1577,"navigation":1578,"path":318,"seo":1579,"stem":319,"__hash__":1581},"docs\u002F7.projects\u002F2.concurrent-url-checker\u002Findex.md",{"type":380,"value":381,"toc":1561},"minimark",[382,388,393,397,408,411,417,421,447,451,478,482,616,619,623,881,884,888,894,944,947,951,964,970,974,977,980,984,990,993,997,1000,1528,1532,1549,1552,1557],[383,384],"learning-lesson-meta",{"level":385,"prerequisites":386,"time":387},"Intermediate","Concurrency section, HTTP clients, command-line configuration, and testing","45–60 minutes",[389,390,392],"h2",{"id":391},"what-you-will-build","What you will build",[394,395,396],"p",{},"A command that checks URLs concurrently while respecting explicit limits:",[398,399,405],"pre",{"className":400,"code":402,"language":403,"meta":404},[401],"language-text","urlcheck --workers=5 --timeout=2s urls.txt\n","text","",[406,407,402],"code",{"__ignoreMap":404},[394,409,410],{},"Example output:",[398,412,415],{"className":413,"code":414,"language":403,"meta":404},[401],"200  142ms  https:\u002F\u002Fexample.com\n404   88ms  https:\u002F\u002Fexample.com\u002Fmissing\nERR  2001ms https:\u002F\u002Funreachable.example  context deadline exceeded\n",[406,416,414],{"__ignoreMap":404},[389,418,420],{"id":419},"what-you-will-learn","What you will learn",[422,423,424,428,431,434,441,444],"ul",{},[425,426,427],"li",{},"bounded worker pools;",[425,429,430],{},"channel ownership and closure;",[425,432,433],{},"request contexts and timeouts;",[425,435,436,437,440],{},"shared ",[406,438,439],{},"http.Client"," reuse;",[425,442,443],{},"ordered reconstruction of concurrent results;",[425,445,446],{},"cancellation and goroutine-completion tests.",[389,448,450],{"id":449},"behaviour-contract","Behaviour contract",[422,452,453,456,459,466,469,472,475],{},[425,454,455],{},"Read one URL per non-empty line.",[425,457,458],{},"Reject malformed or unsupported schemes before starting workers.",[425,460,461,462,465],{},"Run no more than ",[406,463,464],{},"workers"," checks at once.",[425,467,468],{},"Apply a per-request timeout within the overall command context.",[425,470,471],{},"Produce one result for every accepted input unless the command is cancelled.",[425,473,474],{},"Print results in input order even when requests complete out of order.",[425,476,477],{},"Return a non-zero status if any URL fails according to the chosen policy.",[389,479,481],{"id":480},"define-types-before-goroutines","Define types before goroutines",[398,483,487],{"className":484,"code":485,"language":486,"meta":404,"style":404},"language-go shiki shiki-themes solarized-light material-theme one-dark-pro","type Job struct {\n    Index int\n    URL   *url.URL\n}\n\ntype Result struct {\n    Index    int\n    URL      string\n    Status   int\n    Duration time.Duration\n    Err      error\n}\n","go",[406,488,489,509,520,538,544,551,563,571,579,588,602,611],{"__ignoreMap":404},[490,491,494,498,502,505],"span",{"class":492,"line":493},"line",1,[490,495,497],{"class":496},"sEOdo","type",[490,499,501],{"class":500},"snwKR"," Job",[490,503,504],{"class":496}," struct",[490,506,508],{"class":507},"shFME"," {\n",[490,510,512,516],{"class":492,"line":511},2,[490,513,515],{"class":514},"s45-6","    Index",[490,517,519],{"class":518},"sF6sA"," int\n",[490,521,523,526,529,532,535],{"class":492,"line":522},3,[490,524,525],{"class":514},"    URL",[490,527,528],{"class":496},"   *",[490,530,531],{"class":500},"url",[490,533,534],{"class":507},".",[490,536,537],{"class":500},"URL\n",[490,539,541],{"class":492,"line":540},4,[490,542,543],{"class":507},"}\n",[490,545,547],{"class":492,"line":546},5,[490,548,550],{"emptyLinePlaceholder":549},true,"\n",[490,552,554,556,559,561],{"class":492,"line":553},6,[490,555,497],{"class":496},[490,557,558],{"class":500}," Result",[490,560,504],{"class":496},[490,562,508],{"class":507},[490,564,566,568],{"class":492,"line":565},7,[490,567,515],{"class":514},[490,569,570],{"class":518},"    int\n",[490,572,574,576],{"class":492,"line":573},8,[490,575,525],{"class":514},[490,577,578],{"class":518},"      string\n",[490,580,582,585],{"class":492,"line":581},9,[490,583,584],{"class":514},"    Status",[490,586,587],{"class":518},"   int\n",[490,589,591,594,597,599],{"class":492,"line":590},10,[490,592,593],{"class":514},"    Duration",[490,595,596],{"class":500}," time",[490,598,534],{"class":507},[490,600,601],{"class":500},"Duration\n",[490,603,605,608],{"class":492,"line":604},11,[490,606,607],{"class":514},"    Err",[490,609,610],{"class":518},"      error\n",[490,612,614],{"class":492,"line":613},12,[490,615,543],{"class":507},[394,617,618],{},"The index preserves input ordering without forcing workers to finish in order.",[389,620,622],{"id":621},"configuration","Configuration",[398,624,626],{"className":484,"code":625,"language":486,"meta":404,"style":404},"type Config struct {\n    Workers        int\n    RequestTimeout time.Duration\n    MaxInputURLs   int\n}\n\nfunc (c Config) Validate() error {\n    if c.Workers \u003C 1 || c.Workers > 100 {\n        return errors.New(\"workers must be between 1 and 100\")\n    }\n    if c.RequestTimeout \u003C= 0 {\n        return errors.New(\"request timeout must be positive\")\n    }\n    if c.MaxInputURLs \u003C 1 {\n        return errors.New(\"maximum input count must be positive\")\n    }\n    return nil\n}\n",[406,627,628,639,647,658,665,669,673,703,742,771,776,795,816,821,839,861,866,876],{"__ignoreMap":404},[490,629,630,632,635,637],{"class":492,"line":493},[490,631,497],{"class":496},[490,633,634],{"class":500}," Config",[490,636,504],{"class":496},[490,638,508],{"class":507},[490,640,641,644],{"class":492,"line":511},[490,642,643],{"class":514},"    Workers",[490,645,646],{"class":518},"        int\n",[490,648,649,652,654,656],{"class":492,"line":522},[490,650,651],{"class":514},"    RequestTimeout",[490,653,596],{"class":500},[490,655,534],{"class":507},[490,657,601],{"class":500},[490,659,660,663],{"class":492,"line":540},[490,661,662],{"class":514},"    MaxInputURLs",[490,664,587],{"class":518},[490,666,667],{"class":492,"line":546},[490,668,543],{"class":507},[490,670,671],{"class":492,"line":553},[490,672,550],{"emptyLinePlaceholder":549},[490,674,675,678,681,685,688,691,695,698,701],{"class":492,"line":565},[490,676,677],{"class":496},"func",[490,679,680],{"class":507}," (",[490,682,684],{"class":683},"syre3","c ",[490,686,687],{"class":500},"Config",[490,689,690],{"class":507},")",[490,692,694],{"class":693},"sisdC"," Validate",[490,696,697],{"class":507},"()",[490,699,700],{"class":518}," error",[490,702,508],{"class":507},[490,704,705,709,712,714,717,721,725,728,730,732,734,737,740],{"class":492,"line":573},[490,706,708],{"class":707},"s7Bcg","    if",[490,710,711],{"class":514}," c",[490,713,534],{"class":507},[490,715,716],{"class":514},"Workers",[490,718,720],{"class":719},"sRBoR"," \u003C",[490,722,724],{"class":723},"sAJzr"," 1",[490,726,727],{"class":719}," ||",[490,729,711],{"class":514},[490,731,534],{"class":507},[490,733,716],{"class":514},[490,735,736],{"class":719}," >",[490,738,739],{"class":723}," 100",[490,741,508],{"class":507},[490,743,744,747,750,752,755,758,762,766,768],{"class":492,"line":581},[490,745,746],{"class":707},"        return",[490,748,749],{"class":514}," errors",[490,751,534],{"class":507},[490,753,754],{"class":693},"New",[490,756,757],{"class":507},"(",[490,759,761],{"class":760},"sED5a","\"",[490,763,765],{"class":764},"sVazx","workers must be between 1 and 100",[490,767,761],{"class":760},[490,769,770],{"class":507},")\n",[490,772,773],{"class":492,"line":590},[490,774,775],{"class":507},"    }\n",[490,777,778,780,782,784,787,790,793],{"class":492,"line":604},[490,779,708],{"class":707},[490,781,711],{"class":514},[490,783,534],{"class":507},[490,785,786],{"class":514},"RequestTimeout",[490,788,789],{"class":719}," \u003C=",[490,791,792],{"class":723}," 0",[490,794,508],{"class":507},[490,796,797,799,801,803,805,807,809,812,814],{"class":492,"line":613},[490,798,746],{"class":707},[490,800,749],{"class":514},[490,802,534],{"class":507},[490,804,754],{"class":693},[490,806,757],{"class":507},[490,808,761],{"class":760},[490,810,811],{"class":764},"request timeout must be positive",[490,813,761],{"class":760},[490,815,770],{"class":507},[490,817,819],{"class":492,"line":818},13,[490,820,775],{"class":507},[490,822,824,826,828,830,833,835,837],{"class":492,"line":823},14,[490,825,708],{"class":707},[490,827,711],{"class":514},[490,829,534],{"class":507},[490,831,832],{"class":514},"MaxInputURLs",[490,834,720],{"class":719},[490,836,724],{"class":723},[490,838,508],{"class":507},[490,840,842,844,846,848,850,852,854,857,859],{"class":492,"line":841},15,[490,843,746],{"class":707},[490,845,749],{"class":514},[490,847,534],{"class":507},[490,849,754],{"class":693},[490,851,757],{"class":507},[490,853,761],{"class":760},[490,855,856],{"class":764},"maximum input count must be positive",[490,858,761],{"class":760},[490,860,770],{"class":507},[490,862,864],{"class":492,"line":863},16,[490,865,775],{"class":507},[490,867,869,872],{"class":492,"line":868},17,[490,870,871],{"class":707},"    return",[490,873,875],{"class":874},"sp8Z5"," nil\n",[490,877,879],{"class":492,"line":878},18,[490,880,543],{"class":507},[394,882,883],{},"Limits prevent accidental resource explosions. They are product decisions, not universal constants.",[389,885,887],{"id":886},"http-client-ownership","HTTP client ownership",[394,889,890,891,893],{},"Construct one configured client and reuse it across workers. ",[406,892,439],{}," and the default transport are designed for concurrent reuse.",[398,895,897],{"className":484,"code":896,"language":486,"meta":404,"style":404},"client := &http.Client{\n    Timeout: config.RequestTimeout,\n}\n",[406,898,899,922,940],{"__ignoreMap":404},[490,900,901,904,908,911,914,916,919],{"class":492,"line":493},[490,902,903],{"class":514},"client",[490,905,907],{"class":906},"su2KV"," :=",[490,909,910],{"class":496}," &",[490,912,913],{"class":500},"http",[490,915,534],{"class":507},[490,917,918],{"class":500},"Client",[490,920,921],{"class":507},"{\n",[490,923,924,927,930,933,935,937],{"class":492,"line":511},[490,925,926],{"class":514},"    Timeout",[490,928,929],{"class":507},":",[490,931,932],{"class":514}," config",[490,934,534],{"class":507},[490,936,786],{"class":514},[490,938,939],{"class":507},",\n",[490,941,942],{"class":492,"line":522},[490,943,543],{"class":507},[394,945,946],{},"Using both client timeout and request context can be reasonable, but understand which deadline is shorter and which error reaches the caller. In the implementation checkpoint, use one clear per-request child context and a shared client with transport settings appropriate to the exercise.",[389,948,950],{"id":949},"request-method-choice","Request method choice",[394,952,953,956,957,960,961,963],{},[406,954,955],{},"HEAD"," can avoid downloading a response body, but some servers implement it incorrectly or differently from ",[406,958,959],{},"GET",". ",[406,962,959],{}," is more widely representative but requires strict body handling.",[394,965,966,967,969],{},"For this project, use ",[406,968,959],{},", read only a small bounded amount if needed to enable connection reuse, then close the body. Never download unbounded content merely to check availability.",[389,971,973],{"id":972},"security-boundary","Security boundary",[394,975,976],{},"For a local CLI checking URLs supplied by its user, the user controls the destinations. If this capability becomes a server endpoint, arbitrary URLs create server-side request forgery risk: clients may reach loopback, cloud metadata, or private networks through your service.",[394,978,979],{},"Do not expose the same implementation as a public URL-check API without strict destination policy, DNS\u002FIP validation that accounts for rebinding, redirect controls, network egress restrictions, and response limits.",[389,981,983],{"id":982},"architecture","Architecture",[398,985,988],{"className":986,"code":987,"language":403,"meta":404},[401],"input parser\n  ↓ indexed jobs\nbounded jobs channel\n  ↓\nN workers using one HTTP client\n  ↓ indexed results\nresult collector\n  ↓ ordered output\n",[406,989,987],{"__ignoreMap":404},[394,991,992],{},"The coordinator owns closing channels. Workers do not close shared channels.",[389,994,996],{"id":995},"practice","Practice",[394,998,999],{},"Implement URL parsing and configuration validation. Produce a slice of indexed jobs without starting any goroutines.",[1001,1002,1003],"accordion",{},[1004,1005,1008,1521],"accordion-item",{"icon":1006,"label":1007},"i-lucide-lightbulb","Show parser outline",[398,1009,1011],{"className":484,"code":1010,"language":486,"meta":404,"style":404},"func ParseURLs(reader io.Reader, maximum int) ([]Job, error) {\n    scanner := bufio.NewScanner(reader)\n    jobs := make([]Job, 0)\n\n    for scanner.Scan() {\n        raw := strings.TrimSpace(scanner.Text())\n        if raw == \"\" {\n            continue\n        }\n        if len(jobs) == maximum {\n            return nil, fmt.Errorf(\"input exceeds maximum of %d URLs\", maximum)\n        }\n\n        parsed, err := url.ParseRequestURI(raw)\n        if err != nil || (parsed.Scheme != \"http\" && parsed.Scheme != \"https\") || parsed.Host == \"\" {\n            return nil, fmt.Errorf(\"line %d contains an invalid HTTP URL\", len(jobs)+1)\n        }\n        jobs = append(jobs, Job{Index: len(jobs), URL: parsed})\n    }\n    if err := scanner.Err(); err != nil {\n        return nil, fmt.Errorf(\"read URLs: %w\", err)\n    }\n    return jobs, nil\n}\n",[406,1012,1013,1058,1079,1100,1104,1121,1149,1165,1170,1175,1195,1235,1239,1243,1270,1338,1384,1388,1434,1439,1466,1499,1504,1516],{"__ignoreMap":404},[490,1014,1015,1017,1020,1022,1025,1028,1030,1033,1036,1039,1042,1044,1047,1050,1052,1054,1056],{"class":492,"line":493},[490,1016,677],{"class":496},[490,1018,1019],{"class":693}," ParseURLs",[490,1021,757],{"class":507},[490,1023,1024],{"class":683},"reader",[490,1026,1027],{"class":500}," io",[490,1029,534],{"class":507},[490,1031,1032],{"class":500},"Reader",[490,1034,1035],{"class":507},",",[490,1037,1038],{"class":683}," maximum",[490,1040,1041],{"class":518}," int",[490,1043,690],{"class":507},[490,1045,1046],{"class":507}," ([]",[490,1048,1049],{"class":500},"Job",[490,1051,1035],{"class":507},[490,1053,700],{"class":518},[490,1055,690],{"class":507},[490,1057,508],{"class":507},[490,1059,1060,1063,1065,1068,1070,1073,1075,1077],{"class":492,"line":511},[490,1061,1062],{"class":514},"    scanner",[490,1064,907],{"class":906},[490,1066,1067],{"class":514}," bufio",[490,1069,534],{"class":507},[490,1071,1072],{"class":693},"NewScanner",[490,1074,757],{"class":507},[490,1076,1024],{"class":514},[490,1078,770],{"class":507},[490,1080,1081,1084,1086,1089,1092,1094,1096,1098],{"class":492,"line":522},[490,1082,1083],{"class":514},"    jobs",[490,1085,907],{"class":906},[490,1087,1088],{"class":693}," make",[490,1090,1091],{"class":507},"([]",[490,1093,1049],{"class":500},[490,1095,1035],{"class":507},[490,1097,792],{"class":723},[490,1099,770],{"class":507},[490,1101,1102],{"class":492,"line":540},[490,1103,550],{"emptyLinePlaceholder":549},[490,1105,1106,1109,1112,1114,1117,1119],{"class":492,"line":546},[490,1107,1108],{"class":707},"    for",[490,1110,1111],{"class":514}," scanner",[490,1113,534],{"class":507},[490,1115,1116],{"class":693},"Scan",[490,1118,697],{"class":507},[490,1120,508],{"class":507},[490,1122,1123,1126,1128,1131,1133,1136,1138,1141,1143,1146],{"class":492,"line":553},[490,1124,1125],{"class":514},"        raw",[490,1127,907],{"class":906},[490,1129,1130],{"class":514}," strings",[490,1132,534],{"class":507},[490,1134,1135],{"class":693},"TrimSpace",[490,1137,757],{"class":507},[490,1139,1140],{"class":514},"scanner",[490,1142,534],{"class":507},[490,1144,1145],{"class":693},"Text",[490,1147,1148],{"class":507},"())\n",[490,1150,1151,1154,1157,1160,1163],{"class":492,"line":565},[490,1152,1153],{"class":707},"        if",[490,1155,1156],{"class":514}," raw",[490,1158,1159],{"class":719}," ==",[490,1161,1162],{"class":760}," \"\"",[490,1164,508],{"class":507},[490,1166,1167],{"class":492,"line":573},[490,1168,1169],{"class":707},"            continue\n",[490,1171,1172],{"class":492,"line":581},[490,1173,1174],{"class":507},"        }\n",[490,1176,1177,1179,1182,1184,1187,1189,1191,1193],{"class":492,"line":590},[490,1178,1153],{"class":707},[490,1180,1181],{"class":693}," len",[490,1183,757],{"class":507},[490,1185,1186],{"class":514},"jobs",[490,1188,690],{"class":507},[490,1190,1159],{"class":719},[490,1192,1038],{"class":514},[490,1194,508],{"class":507},[490,1196,1197,1200,1203,1205,1208,1210,1213,1215,1217,1220,1224,1227,1229,1231,1233],{"class":492,"line":604},[490,1198,1199],{"class":707},"            return",[490,1201,1202],{"class":874}," nil",[490,1204,1035],{"class":507},[490,1206,1207],{"class":514}," fmt",[490,1209,534],{"class":507},[490,1211,1212],{"class":693},"Errorf",[490,1214,757],{"class":507},[490,1216,761],{"class":760},[490,1218,1219],{"class":764},"input exceeds maximum of ",[490,1221,1223],{"class":1222},"st3jj","%d",[490,1225,1226],{"class":764}," URLs",[490,1228,761],{"class":760},[490,1230,1035],{"class":507},[490,1232,1038],{"class":514},[490,1234,770],{"class":507},[490,1236,1237],{"class":492,"line":613},[490,1238,1174],{"class":507},[490,1240,1241],{"class":492,"line":818},[490,1242,550],{"emptyLinePlaceholder":549},[490,1244,1245,1248,1250,1253,1255,1258,1260,1263,1265,1268],{"class":492,"line":823},[490,1246,1247],{"class":514},"        parsed",[490,1249,1035],{"class":507},[490,1251,1252],{"class":514}," err",[490,1254,907],{"class":906},[490,1256,1257],{"class":514}," url",[490,1259,534],{"class":507},[490,1261,1262],{"class":693},"ParseRequestURI",[490,1264,757],{"class":507},[490,1266,1267],{"class":514},"raw",[490,1269,770],{"class":507},[490,1271,1272,1274,1276,1279,1281,1283,1285,1288,1290,1293,1295,1298,1300,1302,1305,1308,1310,1312,1314,1316,1319,1321,1323,1325,1327,1329,1332,1334,1336],{"class":492,"line":841},[490,1273,1153],{"class":707},[490,1275,1252],{"class":514},[490,1277,1278],{"class":719}," !=",[490,1280,1202],{"class":874},[490,1282,727],{"class":719},[490,1284,680],{"class":507},[490,1286,1287],{"class":514},"parsed",[490,1289,534],{"class":507},[490,1291,1292],{"class":514},"Scheme",[490,1294,1278],{"class":719},[490,1296,1297],{"class":760}," \"",[490,1299,913],{"class":764},[490,1301,761],{"class":760},[490,1303,1304],{"class":719}," &&",[490,1306,1307],{"class":514}," parsed",[490,1309,534],{"class":507},[490,1311,1292],{"class":514},[490,1313,1278],{"class":719},[490,1315,1297],{"class":760},[490,1317,1318],{"class":764},"https",[490,1320,761],{"class":760},[490,1322,690],{"class":507},[490,1324,727],{"class":719},[490,1326,1307],{"class":514},[490,1328,534],{"class":507},[490,1330,1331],{"class":514},"Host",[490,1333,1159],{"class":719},[490,1335,1162],{"class":760},[490,1337,508],{"class":507},[490,1339,1340,1342,1344,1346,1348,1350,1352,1354,1356,1359,1361,1364,1366,1368,1370,1372,1374,1376,1379,1382],{"class":492,"line":863},[490,1341,1199],{"class":707},[490,1343,1202],{"class":874},[490,1345,1035],{"class":507},[490,1347,1207],{"class":514},[490,1349,534],{"class":507},[490,1351,1212],{"class":693},[490,1353,757],{"class":507},[490,1355,761],{"class":760},[490,1357,1358],{"class":764},"line ",[490,1360,1223],{"class":1222},[490,1362,1363],{"class":764}," contains an invalid HTTP URL",[490,1365,761],{"class":760},[490,1367,1035],{"class":507},[490,1369,1181],{"class":693},[490,1371,757],{"class":507},[490,1373,1186],{"class":514},[490,1375,690],{"class":507},[490,1377,1378],{"class":496},"+",[490,1380,1381],{"class":723},"1",[490,1383,770],{"class":507},[490,1385,1386],{"class":492,"line":868},[490,1387,1174],{"class":507},[490,1389,1390,1393,1396,1399,1401,1403,1405,1407,1410,1413,1415,1417,1419,1421,1424,1427,1429,1431],{"class":492,"line":878},[490,1391,1392],{"class":514},"        jobs",[490,1394,1395],{"class":906}," =",[490,1397,1398],{"class":693}," append",[490,1400,757],{"class":507},[490,1402,1186],{"class":514},[490,1404,1035],{"class":507},[490,1406,501],{"class":500},[490,1408,1409],{"class":507},"{",[490,1411,1412],{"class":514},"Index",[490,1414,929],{"class":507},[490,1416,1181],{"class":693},[490,1418,757],{"class":507},[490,1420,1186],{"class":514},[490,1422,1423],{"class":507},"),",[490,1425,1426],{"class":514}," URL",[490,1428,929],{"class":507},[490,1430,1307],{"class":514},[490,1432,1433],{"class":507},"})\n",[490,1435,1437],{"class":492,"line":1436},19,[490,1438,775],{"class":507},[490,1440,1442,1444,1446,1448,1450,1452,1455,1458,1460,1462,1464],{"class":492,"line":1441},20,[490,1443,708],{"class":707},[490,1445,1252],{"class":514},[490,1447,907],{"class":906},[490,1449,1111],{"class":514},[490,1451,534],{"class":507},[490,1453,1454],{"class":693},"Err",[490,1456,1457],{"class":507},"();",[490,1459,1252],{"class":514},[490,1461,1278],{"class":719},[490,1463,1202],{"class":874},[490,1465,508],{"class":507},[490,1467,1469,1471,1473,1475,1477,1479,1481,1483,1485,1488,1491,1493,1495,1497],{"class":492,"line":1468},21,[490,1470,746],{"class":707},[490,1472,1202],{"class":874},[490,1474,1035],{"class":507},[490,1476,1207],{"class":514},[490,1478,534],{"class":507},[490,1480,1212],{"class":693},[490,1482,757],{"class":507},[490,1484,761],{"class":760},[490,1486,1487],{"class":764},"read URLs: ",[490,1489,1490],{"class":1222},"%w",[490,1492,761],{"class":760},[490,1494,1035],{"class":507},[490,1496,1252],{"class":514},[490,1498,770],{"class":507},[490,1500,1502],{"class":492,"line":1501},22,[490,1503,775],{"class":507},[490,1505,1507,1509,1512,1514],{"class":492,"line":1506},23,[490,1508,871],{"class":707},[490,1510,1511],{"class":514}," jobs",[490,1513,1035],{"class":507},[490,1515,875],{"class":874},[490,1517,1519],{"class":492,"line":1518},24,[490,1520,543],{"class":507},[394,1522,1523,1524,1527],{},"For precise source line numbers, maintain a separate line counter because skipped blank lines make ",[406,1525,1526],{},"len(jobs)+1"," inaccurate. That improvement is part of the exercise review.",[389,1529,1531],{"id":1530},"summary","Summary",[422,1533,1534,1537,1540,1543,1546],{},[425,1535,1536],{},"Define observable behaviour and resource bounds before adding goroutines.",[425,1538,1539],{},"Index jobs so output order is independent of completion order.",[425,1541,1542],{},"Reuse one configured HTTP client.",[425,1544,1545],{},"Limit response handling and always close successful bodies.",[425,1547,1548],{},"Treat user-controlled server-side destinations as a serious security boundary.",[1550,1551],"learning-lesson-complete",{},[1553,1554],"learning-lesson-navigation",{"next":326,"next-label":1555,"previous":313,"previous-label":1556},"URL Checker: Worker Pipeline","CLI: Commands and Tests",[1558,1559,1560],"style",{},"html pre.shiki code .sEOdo, html code.shiki .sEOdo{--shiki-light:#859900;--shiki-default:#89DDFF;--shiki-dark:#C678DD}html pre.shiki code .snwKR, html code.shiki .snwKR{--shiki-light:#CB4B16;--shiki-default:#FFCB6B;--shiki-dark:#E5C07B}html pre.shiki code .shFME, html code.shiki .shFME{--shiki-light:#657B83;--shiki-default:#89DDFF;--shiki-dark:#ABB2BF}html pre.shiki code .s45-6, html code.shiki .s45-6{--shiki-light:#268BD2;--shiki-default:#EEFFFF;--shiki-dark:#E06C75}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 .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 .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 .sisdC, html code.shiki .sisdC{--shiki-light:#268BD2;--shiki-default:#82AAFF;--shiki-dark:#61AFEF}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 .sAJzr, html code.shiki .sAJzr{--shiki-light:#D33682;--shiki-default:#F78C6C;--shiki-dark:#D19A66}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 .sp8Z5, html code.shiki .sp8Z5{--shiki-light:#B58900;--shiki-default:#89DDFF;--shiki-dark:#D19A66}html pre.shiki code .su2KV, html code.shiki .su2KV{--shiki-light:#859900;--shiki-default:#89DDFF;--shiki-dark:#E5C07B}html pre.shiki code .st3jj, html code.shiki .st3jj{--shiki-light:#CB4B16;--shiki-default:#F07178;--shiki-dark:#D19A66}",{"title":404,"searchDepth":511,"depth":511,"links":1562},[1563,1564,1565,1566,1567,1568,1569,1570,1571,1572,1573],{"id":391,"depth":511,"text":392},{"id":419,"depth":511,"text":420},{"id":449,"depth":511,"text":450},{"id":480,"depth":511,"text":481},{"id":621,"depth":511,"text":622},{"id":886,"depth":511,"text":887},{"id":949,"depth":511,"text":950},{"id":972,"depth":511,"text":973},{"id":982,"depth":511,"text":983},{"id":995,"depth":511,"text":996},{"id":1530,"depth":511,"text":1531},"Design a bounded URL checker that demonstrates goroutines, channels, cancellation, and HTTP ownership.","md",null,{},{"icon":323},{"description":1580,"title":322},"Begin a concurrent Go URL-checker project with bounded workers, timeouts, ordered results, and clear cancellation.","oz3eawWr8JUKmCP9Cni_syPyNbjAY2C-qqLPez_MUjI",[1583,1585],{"title":312,"path":313,"stem":314,"description":1584,"icon":315,"children":-1},"Connect commands to the service, make output testable, and finish the task manager with behavioural tests.",{"title":325,"path":326,"stem":327,"description":1586,"icon":128,"children":-1},"Implement bounded workers, request lifetimes, result ownership, and ordered collection.",1794118104902]