[{"data":1,"prerenderedAt":1751},["ShallowReactive",2],{"navigation_docs":3,"-backend-development-application-wiring":377,"-backend-development-application-wiring-surround":1746},[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":220,"body":379,"description":1738,"extension":1739,"links":1740,"meta":1741,"navigation":1742,"path":221,"seo":1743,"stem":222,"__hash__":1745},"docs\u002F5.backend-development\u002F5.application-wiring.md",{"type":380,"value":381,"toc":1726},"minimark",[382,388,393,397,416,420,428,438,441,445,698,701,705,716,719,723,1219,1228,1231,1235,1256,1259,1263,1266,1292,1295,1299,1337,1341,1344,1695,1699,1716,1719,1722],[383,384],"learning-lesson-meta",{"level":385,"prerequisites":386,"time":387},"Intermediate","Configuration, interfaces, HTTP servers, and error handling","40–55 minutes",[389,390,392],"h2",{"id":391},"what-you-will-learn","What you will learn",[394,395,396],"p",{},"By the end of this lesson, you will be able to:",[398,399,400,404,407,410,413],"ul",{},[401,402,403],"li",{},"keep process wiring separate from application behaviour;",[401,405,406],{},"use constructors to enforce required dependencies;",[401,408,409],{},"choose between concrete dependencies and interfaces;",[401,411,412],{},"distinguish liveness, readiness, and startup checks;",[401,414,415],{},"clean up partially created resources safely.",[389,417,419],{"id":418},"mental-model-one-place-builds-the-object-graph","Mental model: one place builds the object graph",[394,421,422,423,427],{},"The composition root is the outermost code that knows concrete implementations. In a Go service, this normally lives under ",[424,425,426],"code",{},"cmd\u002F\u003Cname>",".",[429,430,436],"pre",{"className":431,"code":433,"language":434,"meta":435},[432],"language-text","main\n  ├── load configuration\n  ├── configure logger\n  ├── open database pool\n  ├── create repositories\n  ├── create services\n  ├── create HTTP handlers and server\n  └── run and shut everything down\n","text","",[424,437,433],{"__ignoreMap":435},[394,439,440],{},"Business packages should not open their own databases, read process environment variables, or construct global loggers behind the caller's back.",[389,442,444],{"id":443},"constructors-make-requirements-explicit","Constructors make requirements explicit",[429,446,450],{"className":447,"code":448,"language":449,"meta":435,"style":435},"language-go shiki shiki-themes solarized-light material-theme one-dark-pro","type LessonService struct {\n    repository LessonRepository\n    clock      Clock\n}\n\nfunc NewLessonService(repository LessonRepository, clock Clock) (*LessonService, error) {\n    if repository == nil {\n        return nil, errors.New(\"lesson repository is required\")\n    }\n    if clock == nil {\n        return nil, errors.New(\"clock is required\")\n    }\n    return &LessonService{repository: repository, clock: clock}, nil\n}\n","go",[424,451,452,472,482,491,497,504,555,575,608,614,627,653,658,693],{"__ignoreMap":435},[453,454,457,461,465,468],"span",{"class":455,"line":456},"line",1,[453,458,460],{"class":459},"sEOdo","type",[453,462,464],{"class":463},"snwKR"," LessonService",[453,466,467],{"class":459}," struct",[453,469,471],{"class":470},"shFME"," {\n",[453,473,475,479],{"class":455,"line":474},2,[453,476,478],{"class":477},"s45-6","    repository",[453,480,481],{"class":463}," LessonRepository\n",[453,483,485,488],{"class":455,"line":484},3,[453,486,487],{"class":477},"    clock",[453,489,490],{"class":463},"      Clock\n",[453,492,494],{"class":455,"line":493},4,[453,495,496],{"class":470},"}\n",[453,498,500],{"class":455,"line":499},5,[453,501,503],{"emptyLinePlaceholder":502},true,"\n",[453,505,507,510,514,517,521,524,527,530,533,536,539,542,545,547,551,553],{"class":455,"line":506},6,[453,508,509],{"class":459},"func",[453,511,513],{"class":512},"sisdC"," NewLessonService",[453,515,516],{"class":470},"(",[453,518,520],{"class":519},"syre3","repository",[453,522,523],{"class":463}," LessonRepository",[453,525,526],{"class":470},",",[453,528,529],{"class":519}," clock",[453,531,532],{"class":463}," Clock",[453,534,535],{"class":470},")",[453,537,538],{"class":470}," (",[453,540,541],{"class":459},"*",[453,543,544],{"class":463},"LessonService",[453,546,526],{"class":470},[453,548,550],{"class":549},"sF6sA"," error",[453,552,535],{"class":470},[453,554,471],{"class":470},[453,556,558,562,565,569,573],{"class":455,"line":557},7,[453,559,561],{"class":560},"s7Bcg","    if",[453,563,564],{"class":477}," repository",[453,566,568],{"class":567},"sRBoR"," ==",[453,570,572],{"class":571},"sp8Z5"," nil",[453,574,471],{"class":470},[453,576,578,581,583,585,588,590,593,595,599,603,605],{"class":455,"line":577},8,[453,579,580],{"class":560},"        return",[453,582,572],{"class":571},[453,584,526],{"class":470},[453,586,587],{"class":477}," errors",[453,589,427],{"class":470},[453,591,592],{"class":512},"New",[453,594,516],{"class":470},[453,596,598],{"class":597},"sED5a","\"",[453,600,602],{"class":601},"sVazx","lesson repository is required",[453,604,598],{"class":597},[453,606,607],{"class":470},")\n",[453,609,611],{"class":455,"line":610},9,[453,612,613],{"class":470},"    }\n",[453,615,617,619,621,623,625],{"class":455,"line":616},10,[453,618,561],{"class":560},[453,620,529],{"class":477},[453,622,568],{"class":567},[453,624,572],{"class":571},[453,626,471],{"class":470},[453,628,630,632,634,636,638,640,642,644,646,649,651],{"class":455,"line":629},11,[453,631,580],{"class":560},[453,633,572],{"class":571},[453,635,526],{"class":470},[453,637,587],{"class":477},[453,639,427],{"class":470},[453,641,592],{"class":512},[453,643,516],{"class":470},[453,645,598],{"class":597},[453,647,648],{"class":601},"clock is required",[453,650,598],{"class":597},[453,652,607],{"class":470},[453,654,656],{"class":455,"line":655},12,[453,657,613],{"class":470},[453,659,661,664,667,669,672,674,677,679,681,683,685,687,690],{"class":455,"line":660},13,[453,662,663],{"class":560},"    return",[453,665,666],{"class":459}," &",[453,668,544],{"class":463},[453,670,671],{"class":470},"{",[453,673,520],{"class":477},[453,675,676],{"class":470},":",[453,678,564],{"class":477},[453,680,526],{"class":470},[453,682,529],{"class":477},[453,684,676],{"class":470},[453,686,529],{"class":477},[453,688,689],{"class":470},"},",[453,691,692],{"class":571}," nil\n",[453,694,696],{"class":455,"line":695},14,[453,697,496],{"class":470},[394,699,700],{},"Constructors are ordinary functions. Use one when values need validation, defaults, invariants, or unexported fields. A plain struct literal is fine for simple data.",[389,702,704],{"id":703},"prefer-concrete-dependencies-until-abstraction-helps","Prefer concrete dependencies until abstraction helps",[394,706,707,708,711,712,715],{},"A constructor can accept ",[424,709,710],{},"*sql.DB"," or ",[424,713,714],{},"*slog.Logger"," directly when the package genuinely depends on that concrete API. Introduce a small interface at the consumer when substituting behaviour creates a useful boundary.",[394,717,718],{},"Avoid large “service container” interfaces that expose every dependency to every package.",[389,720,722],{"id":721},"build-in-stages","Build in stages",[429,724,726],{"className":447,"code":725,"language":449,"meta":435,"style":435},"func buildApplication(ctx context.Context, config Config, logger *slog.Logger) (_ *Application, err error) {\n    database, err := sql.Open(config.Database.Driver, config.Database.DSN)\n    if err != nil {\n        return nil, fmt.Errorf(\"open database handle: %w\", err)\n    }\n\n    defer func() {\n        if err != nil {\n            _ = database.Close()\n        }\n    }()\n\n    pingCtx, cancel := context.WithTimeout(ctx, config.Database.StartupTimeout)\n    defer cancel()\n    if err := database.PingContext(pingCtx); err != nil {\n        return nil, fmt.Errorf(\"ping database: %w\", err)\n    }\n\n    repository := postgres.NewLessonRepository(database)\n    service, err := lesson.NewService(repository)\n    if err != nil {\n        return nil, fmt.Errorf(\"create lesson service: %w\", err)\n    }\n\n    return NewApplication(config, logger, database, service), nil\n}\n",[424,727,728,795,846,859,894,898,902,915,928,947,952,957,961,999,1007,1039,1071,1076,1081,1103,1129,1142,1174,1179,1184,1214],{"__ignoreMap":435},[453,729,730,732,735,737,740,743,745,748,750,753,756,758,761,764,767,769,772,774,776,779,781,784,786,789,791,793],{"class":455,"line":456},[453,731,509],{"class":459},[453,733,734],{"class":512}," buildApplication",[453,736,516],{"class":470},[453,738,739],{"class":519},"ctx",[453,741,742],{"class":463}," context",[453,744,427],{"class":470},[453,746,747],{"class":463},"Context",[453,749,526],{"class":470},[453,751,752],{"class":519}," config",[453,754,755],{"class":463}," Config",[453,757,526],{"class":470},[453,759,760],{"class":519}," logger",[453,762,763],{"class":459}," *",[453,765,766],{"class":463},"slog",[453,768,427],{"class":470},[453,770,771],{"class":463},"Logger",[453,773,535],{"class":470},[453,775,538],{"class":470},[453,777,778],{"class":519},"_",[453,780,763],{"class":459},[453,782,783],{"class":463},"Application",[453,785,526],{"class":470},[453,787,788],{"class":519}," err",[453,790,550],{"class":549},[453,792,535],{"class":470},[453,794,471],{"class":470},[453,796,797,800,802,804,808,811,813,816,818,821,823,826,828,831,833,835,837,839,841,844],{"class":455,"line":474},[453,798,799],{"class":477},"    database",[453,801,526],{"class":470},[453,803,788],{"class":477},[453,805,807],{"class":806},"su2KV"," :=",[453,809,810],{"class":477}," sql",[453,812,427],{"class":470},[453,814,815],{"class":512},"Open",[453,817,516],{"class":470},[453,819,820],{"class":477},"config",[453,822,427],{"class":470},[453,824,825],{"class":477},"Database",[453,827,427],{"class":470},[453,829,830],{"class":477},"Driver",[453,832,526],{"class":470},[453,834,752],{"class":477},[453,836,427],{"class":470},[453,838,825],{"class":477},[453,840,427],{"class":470},[453,842,843],{"class":477},"DSN",[453,845,607],{"class":470},[453,847,848,850,852,855,857],{"class":455,"line":484},[453,849,561],{"class":560},[453,851,788],{"class":477},[453,853,854],{"class":567}," !=",[453,856,572],{"class":571},[453,858,471],{"class":470},[453,860,861,863,865,867,870,872,875,877,879,882,886,888,890,892],{"class":455,"line":493},[453,862,580],{"class":560},[453,864,572],{"class":571},[453,866,526],{"class":470},[453,868,869],{"class":477}," fmt",[453,871,427],{"class":470},[453,873,874],{"class":512},"Errorf",[453,876,516],{"class":470},[453,878,598],{"class":597},[453,880,881],{"class":601},"open database handle: ",[453,883,885],{"class":884},"st3jj","%w",[453,887,598],{"class":597},[453,889,526],{"class":470},[453,891,788],{"class":477},[453,893,607],{"class":470},[453,895,896],{"class":455,"line":499},[453,897,613],{"class":470},[453,899,900],{"class":455,"line":506},[453,901,503],{"emptyLinePlaceholder":502},[453,903,904,907,910,913],{"class":455,"line":557},[453,905,906],{"class":560},"    defer",[453,908,909],{"class":459}," func",[453,911,912],{"class":470},"()",[453,914,471],{"class":470},[453,916,917,920,922,924,926],{"class":455,"line":577},[453,918,919],{"class":560},"        if",[453,921,788],{"class":477},[453,923,854],{"class":567},[453,925,572],{"class":571},[453,927,471],{"class":470},[453,929,930,933,936,939,941,944],{"class":455,"line":610},[453,931,932],{"class":477},"            _",[453,934,935],{"class":806}," =",[453,937,938],{"class":477}," database",[453,940,427],{"class":470},[453,942,943],{"class":512},"Close",[453,945,946],{"class":470},"()\n",[453,948,949],{"class":455,"line":616},[453,950,951],{"class":470},"        }\n",[453,953,954],{"class":455,"line":629},[453,955,956],{"class":470},"    }()\n",[453,958,959],{"class":455,"line":655},[453,960,503],{"emptyLinePlaceholder":502},[453,962,963,966,968,971,973,975,977,980,982,984,986,988,990,992,994,997],{"class":455,"line":660},[453,964,965],{"class":477},"    pingCtx",[453,967,526],{"class":470},[453,969,970],{"class":477}," cancel",[453,972,807],{"class":806},[453,974,742],{"class":477},[453,976,427],{"class":470},[453,978,979],{"class":512},"WithTimeout",[453,981,516],{"class":470},[453,983,739],{"class":477},[453,985,526],{"class":470},[453,987,752],{"class":477},[453,989,427],{"class":470},[453,991,825],{"class":477},[453,993,427],{"class":470},[453,995,996],{"class":477},"StartupTimeout",[453,998,607],{"class":470},[453,1000,1001,1003,1005],{"class":455,"line":695},[453,1002,906],{"class":560},[453,1004,970],{"class":512},[453,1006,946],{"class":470},[453,1008,1010,1012,1014,1016,1018,1020,1023,1025,1028,1031,1033,1035,1037],{"class":455,"line":1009},15,[453,1011,561],{"class":560},[453,1013,788],{"class":477},[453,1015,807],{"class":806},[453,1017,938],{"class":477},[453,1019,427],{"class":470},[453,1021,1022],{"class":512},"PingContext",[453,1024,516],{"class":470},[453,1026,1027],{"class":477},"pingCtx",[453,1029,1030],{"class":470},");",[453,1032,788],{"class":477},[453,1034,854],{"class":567},[453,1036,572],{"class":571},[453,1038,471],{"class":470},[453,1040,1042,1044,1046,1048,1050,1052,1054,1056,1058,1061,1063,1065,1067,1069],{"class":455,"line":1041},16,[453,1043,580],{"class":560},[453,1045,572],{"class":571},[453,1047,526],{"class":470},[453,1049,869],{"class":477},[453,1051,427],{"class":470},[453,1053,874],{"class":512},[453,1055,516],{"class":470},[453,1057,598],{"class":597},[453,1059,1060],{"class":601},"ping database: ",[453,1062,885],{"class":884},[453,1064,598],{"class":597},[453,1066,526],{"class":470},[453,1068,788],{"class":477},[453,1070,607],{"class":470},[453,1072,1074],{"class":455,"line":1073},17,[453,1075,613],{"class":470},[453,1077,1079],{"class":455,"line":1078},18,[453,1080,503],{"emptyLinePlaceholder":502},[453,1082,1084,1086,1088,1091,1093,1096,1098,1101],{"class":455,"line":1083},19,[453,1085,478],{"class":477},[453,1087,807],{"class":806},[453,1089,1090],{"class":477}," postgres",[453,1092,427],{"class":470},[453,1094,1095],{"class":512},"NewLessonRepository",[453,1097,516],{"class":470},[453,1099,1100],{"class":477},"database",[453,1102,607],{"class":470},[453,1104,1106,1109,1111,1113,1115,1118,1120,1123,1125,1127],{"class":455,"line":1105},20,[453,1107,1108],{"class":477},"    service",[453,1110,526],{"class":470},[453,1112,788],{"class":477},[453,1114,807],{"class":806},[453,1116,1117],{"class":477}," lesson",[453,1119,427],{"class":470},[453,1121,1122],{"class":512},"NewService",[453,1124,516],{"class":470},[453,1126,520],{"class":477},[453,1128,607],{"class":470},[453,1130,1132,1134,1136,1138,1140],{"class":455,"line":1131},21,[453,1133,561],{"class":560},[453,1135,788],{"class":477},[453,1137,854],{"class":567},[453,1139,572],{"class":571},[453,1141,471],{"class":470},[453,1143,1145,1147,1149,1151,1153,1155,1157,1159,1161,1164,1166,1168,1170,1172],{"class":455,"line":1144},22,[453,1146,580],{"class":560},[453,1148,572],{"class":571},[453,1150,526],{"class":470},[453,1152,869],{"class":477},[453,1154,427],{"class":470},[453,1156,874],{"class":512},[453,1158,516],{"class":470},[453,1160,598],{"class":597},[453,1162,1163],{"class":601},"create lesson service: ",[453,1165,885],{"class":884},[453,1167,598],{"class":597},[453,1169,526],{"class":470},[453,1171,788],{"class":477},[453,1173,607],{"class":470},[453,1175,1177],{"class":455,"line":1176},23,[453,1178,613],{"class":470},[453,1180,1182],{"class":455,"line":1181},24,[453,1183,503],{"emptyLinePlaceholder":502},[453,1185,1187,1189,1192,1194,1196,1198,1200,1202,1204,1206,1209,1212],{"class":455,"line":1186},25,[453,1188,663],{"class":560},[453,1190,1191],{"class":512}," NewApplication",[453,1193,516],{"class":470},[453,1195,820],{"class":477},[453,1197,526],{"class":470},[453,1199,760],{"class":477},[453,1201,526],{"class":470},[453,1203,938],{"class":477},[453,1205,526],{"class":470},[453,1207,1208],{"class":477}," service",[453,1210,1211],{"class":470},"),",[453,1213,692],{"class":571},[453,1215,1217],{"class":455,"line":1216},26,[453,1218,496],{"class":470},[394,1220,1221,1224,1225,1227],{},[424,1222,1223],{},"sql.Open"," may not establish a connection immediately, so a bounded ",[424,1226,1022],{}," checks startup connectivity when the service requires the database before serving traffic.",[394,1229,1230],{},"Whether startup should fail during a temporary dependency outage is an operational choice. Some systems fail fast and let an orchestrator retry; others start unready and reconnect. Document the policy.",[389,1232,1234],{"id":1233},"health-endpoints-have-different-meanings","Health endpoints have different meanings",[398,1236,1237,1244,1250],{},[401,1238,1239,1243],{},[1240,1241,1242],"strong",{},"Liveness:"," Is the process responsive, or should it be restarted? Avoid making it fail solely because a downstream dependency is temporarily unavailable.",[401,1245,1246,1249],{},[1240,1247,1248],{},"Readiness:"," Can this instance safely receive normal traffic now? Dependency or migration state may matter.",[401,1251,1252,1255],{},[1240,1253,1254],{},"Startup:"," Has slow initialisation finished? Some orchestrators support a separate startup probe.",[394,1257,1258],{},"Keep responses small and avoid exposing dependency addresses, credentials, build internals, or stack traces.",[389,1260,1262],{"id":1261},"avoid-global-mutable-dependencies","Avoid global mutable dependencies",[394,1264,1265],{},"Package globals make test order significant and prevent multiple differently configured instances in one process.",[429,1267,1269],{"className":447,"code":1268,"language":449,"meta":435,"style":435},"var database *sql.DB \u002F\u002F avoid as hidden shared state\n",[424,1270,1271],{"__ignoreMap":435},[453,1272,1273,1276,1278,1280,1283,1285,1288],{"class":455,"line":456},[453,1274,1275],{"class":459},"var",[453,1277,938],{"class":477},[453,1279,763],{"class":459},[453,1281,1282],{"class":463},"sql",[453,1284,427],{"class":470},[453,1286,1287],{"class":463},"DB",[453,1289,1291],{"class":1290},"sJsHy"," \u002F\u002F avoid as hidden shared state\n",[394,1293,1294],{},"Pass dependencies through constructors and receiver fields instead.",[389,1296,1298],{"id":1297},"common-mistakes","Common mistakes",[398,1300,1301,1307,1313,1319,1325,1331],{},[401,1302,1303,1306],{},[1240,1304,1305],{},"A constructor that performs unlimited network work:"," startup can hang without a caller-controlled context or timeout.",[401,1308,1309,1312],{},[1240,1310,1311],{},"Interfaces owned by implementations:"," they grow to expose every method rather than the consumer's need.",[401,1314,1315,1318],{},[1240,1316,1317],{},"One giant dependency struct passed everywhere:"," dependencies remain hidden, only behind a different name.",[401,1320,1321,1324],{},[1240,1322,1323],{},"Readiness that always returns success:"," traffic reaches an instance unable to perform its main function.",[401,1326,1327,1330],{},[1240,1328,1329],{},"Liveness tied to every remote dependency:"," one outage causes restart storms.",[401,1332,1333,1336],{},[1240,1334,1335],{},"Forgetting partial cleanup:"," a later constructor failure leaks resources opened earlier.",[389,1338,1340],{"id":1339},"practice","Practice",[394,1342,1343],{},"Design the composition root for a lesson API with configuration, logger, database, repository, service, handler, and HTTP server. Add a bounded startup database check and separate liveness and readiness handlers.",[1345,1346,1347],"accordion",{},[1348,1349,1352,1688],"accordion-item",{"icon":1350,"label":1351},"i-lucide-lightbulb","Show wiring outline",[429,1353,1355],{"className":447,"code":1354,"language":449,"meta":435,"style":435},"func run(ctx context.Context, config Config) error {\n    logger := newLogger(config.Log)\n\n    database, err := openDatabase(ctx, config.Database)\n    if err != nil {\n        return err\n    }\n    defer database.Close()\n\n    repository := postgres.NewLessonRepository(database)\n    service, err := lesson.NewService(repository, time.Now)\n    if err != nil {\n        return fmt.Errorf(\"create lesson service: %w\", err)\n    }\n\n    readiness := NewReadiness()\n    handler := httpapi.New(service, logger, readiness)\n    server := newHTTPServer(config.HTTP, handler)\n\n    readiness.SetReady(true)\n    return serveUntilCancelled(ctx, server, logger)\n}\n",[424,1356,1357,1386,1407,1411,1438,1450,1457,1461,1473,1477,1495,1527,1539,1565,1569,1573,1585,1615,1641,1645,1662,1684],{"__ignoreMap":435},[453,1358,1359,1361,1364,1366,1368,1370,1372,1374,1376,1378,1380,1382,1384],{"class":455,"line":456},[453,1360,509],{"class":459},[453,1362,1363],{"class":512}," run",[453,1365,516],{"class":470},[453,1367,739],{"class":519},[453,1369,742],{"class":463},[453,1371,427],{"class":470},[453,1373,747],{"class":463},[453,1375,526],{"class":470},[453,1377,752],{"class":519},[453,1379,755],{"class":463},[453,1381,535],{"class":470},[453,1383,550],{"class":549},[453,1385,471],{"class":470},[453,1387,1388,1391,1393,1396,1398,1400,1402,1405],{"class":455,"line":474},[453,1389,1390],{"class":477},"    logger",[453,1392,807],{"class":806},[453,1394,1395],{"class":512}," newLogger",[453,1397,516],{"class":470},[453,1399,820],{"class":477},[453,1401,427],{"class":470},[453,1403,1404],{"class":477},"Log",[453,1406,607],{"class":470},[453,1408,1409],{"class":455,"line":484},[453,1410,503],{"emptyLinePlaceholder":502},[453,1412,1413,1415,1417,1419,1421,1424,1426,1428,1430,1432,1434,1436],{"class":455,"line":493},[453,1414,799],{"class":477},[453,1416,526],{"class":470},[453,1418,788],{"class":477},[453,1420,807],{"class":806},[453,1422,1423],{"class":512}," openDatabase",[453,1425,516],{"class":470},[453,1427,739],{"class":477},[453,1429,526],{"class":470},[453,1431,752],{"class":477},[453,1433,427],{"class":470},[453,1435,825],{"class":477},[453,1437,607],{"class":470},[453,1439,1440,1442,1444,1446,1448],{"class":455,"line":499},[453,1441,561],{"class":560},[453,1443,788],{"class":477},[453,1445,854],{"class":567},[453,1447,572],{"class":571},[453,1449,471],{"class":470},[453,1451,1452,1454],{"class":455,"line":506},[453,1453,580],{"class":560},[453,1455,1456],{"class":477}," err\n",[453,1458,1459],{"class":455,"line":557},[453,1460,613],{"class":470},[453,1462,1463,1465,1467,1469,1471],{"class":455,"line":577},[453,1464,906],{"class":560},[453,1466,938],{"class":477},[453,1468,427],{"class":470},[453,1470,943],{"class":512},[453,1472,946],{"class":470},[453,1474,1475],{"class":455,"line":610},[453,1476,503],{"emptyLinePlaceholder":502},[453,1478,1479,1481,1483,1485,1487,1489,1491,1493],{"class":455,"line":616},[453,1480,478],{"class":477},[453,1482,807],{"class":806},[453,1484,1090],{"class":477},[453,1486,427],{"class":470},[453,1488,1095],{"class":512},[453,1490,516],{"class":470},[453,1492,1100],{"class":477},[453,1494,607],{"class":470},[453,1496,1497,1499,1501,1503,1505,1507,1509,1511,1513,1515,1517,1520,1522,1525],{"class":455,"line":629},[453,1498,1108],{"class":477},[453,1500,526],{"class":470},[453,1502,788],{"class":477},[453,1504,807],{"class":806},[453,1506,1117],{"class":477},[453,1508,427],{"class":470},[453,1510,1122],{"class":512},[453,1512,516],{"class":470},[453,1514,520],{"class":477},[453,1516,526],{"class":470},[453,1518,1519],{"class":477}," time",[453,1521,427],{"class":470},[453,1523,1524],{"class":477},"Now",[453,1526,607],{"class":470},[453,1528,1529,1531,1533,1535,1537],{"class":455,"line":655},[453,1530,561],{"class":560},[453,1532,788],{"class":477},[453,1534,854],{"class":567},[453,1536,572],{"class":571},[453,1538,471],{"class":470},[453,1540,1541,1543,1545,1547,1549,1551,1553,1555,1557,1559,1561,1563],{"class":455,"line":660},[453,1542,580],{"class":560},[453,1544,869],{"class":477},[453,1546,427],{"class":470},[453,1548,874],{"class":512},[453,1550,516],{"class":470},[453,1552,598],{"class":597},[453,1554,1163],{"class":601},[453,1556,885],{"class":884},[453,1558,598],{"class":597},[453,1560,526],{"class":470},[453,1562,788],{"class":477},[453,1564,607],{"class":470},[453,1566,1567],{"class":455,"line":695},[453,1568,613],{"class":470},[453,1570,1571],{"class":455,"line":1009},[453,1572,503],{"emptyLinePlaceholder":502},[453,1574,1575,1578,1580,1583],{"class":455,"line":1041},[453,1576,1577],{"class":477},"    readiness",[453,1579,807],{"class":806},[453,1581,1582],{"class":512}," NewReadiness",[453,1584,946],{"class":470},[453,1586,1587,1590,1592,1595,1597,1599,1601,1604,1606,1608,1610,1613],{"class":455,"line":1073},[453,1588,1589],{"class":477},"    handler",[453,1591,807],{"class":806},[453,1593,1594],{"class":477}," httpapi",[453,1596,427],{"class":470},[453,1598,592],{"class":512},[453,1600,516],{"class":470},[453,1602,1603],{"class":477},"service",[453,1605,526],{"class":470},[453,1607,760],{"class":477},[453,1609,526],{"class":470},[453,1611,1612],{"class":477}," readiness",[453,1614,607],{"class":470},[453,1616,1617,1620,1622,1625,1627,1629,1631,1634,1636,1639],{"class":455,"line":1078},[453,1618,1619],{"class":477},"    server",[453,1621,807],{"class":806},[453,1623,1624],{"class":512}," newHTTPServer",[453,1626,516],{"class":470},[453,1628,820],{"class":477},[453,1630,427],{"class":470},[453,1632,1633],{"class":477},"HTTP",[453,1635,526],{"class":470},[453,1637,1638],{"class":477}," handler",[453,1640,607],{"class":470},[453,1642,1643],{"class":455,"line":1083},[453,1644,503],{"emptyLinePlaceholder":502},[453,1646,1647,1649,1651,1654,1656,1660],{"class":455,"line":1105},[453,1648,1577],{"class":477},[453,1650,427],{"class":470},[453,1652,1653],{"class":512},"SetReady",[453,1655,516],{"class":470},[453,1657,1659],{"class":1658},"sqQ1y","true",[453,1661,607],{"class":470},[453,1663,1664,1666,1669,1671,1673,1675,1678,1680,1682],{"class":455,"line":1131},[453,1665,663],{"class":560},[453,1667,1668],{"class":512}," serveUntilCancelled",[453,1670,516],{"class":470},[453,1672,739],{"class":477},[453,1674,526],{"class":470},[453,1676,1677],{"class":477}," server",[453,1679,526],{"class":470},[453,1681,760],{"class":477},[453,1683,607],{"class":470},[453,1685,1686],{"class":455,"line":1144},[453,1687,496],{"class":470},[394,1689,1690,1691,1694],{},"The outline makes lifetime ownership visible: ",[424,1692,1693],{},"run"," opens and closes the database, owns server shutdown, and marks readiness only after construction succeeds. Production code should make readiness state concurrency-safe and decide how loss of a required dependency changes that state.",[389,1696,1698],{"id":1697},"summary","Summary",[398,1700,1701,1704,1707,1710,1713],{},[401,1702,1703],{},"Build concrete dependencies in one outer composition root.",[401,1705,1706],{},"Constructors enforce required inputs and invariants.",[401,1708,1709],{},"Prefer narrow consumer-owned interfaces where substitution is useful.",[401,1711,1712],{},"Bound startup I\u002FO and clean up resources when later construction fails.",[401,1714,1715],{},"Give liveness, readiness, and startup checks distinct operational meanings.",[1717,1718],"learning-lesson-complete",{},[1720,1721],"learning-lesson-navigation",{"next":226,"next-label":225,"previous":216,"previous-label":215},[1723,1724,1725],"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 .sisdC, html code.shiki .sisdC{--shiki-light:#268BD2;--shiki-default:#82AAFF;--shiki-dark:#61AFEF}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 .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 .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 .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 .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 .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}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}html pre.shiki code .sqQ1y, html code.shiki .sqQ1y{--shiki-light:#B58900;--shiki-default:#FF9CAC;--shiki-dark:#D19A66}",{"title":435,"searchDepth":474,"depth":474,"links":1727},[1728,1729,1730,1731,1732,1733,1734,1735,1736,1737],{"id":391,"depth":474,"text":392},{"id":418,"depth":474,"text":419},{"id":443,"depth":474,"text":444},{"id":703,"depth":474,"text":704},{"id":721,"depth":474,"text":722},{"id":1233,"depth":474,"text":1234},{"id":1261,"depth":474,"text":1262},{"id":1297,"depth":474,"text":1298},{"id":1339,"depth":474,"text":1340},{"id":1697,"depth":474,"text":1698},"Build a small composition root that loads configuration, creates dependencies, and controls startup.","md",null,{},{"icon":223},{"description":1744,"title":220},"Learn dependency injection, constructors, composition roots, startup checks, health, and readiness in a Go backend.","NXor6IiW1kY0UH1PnCHQSfn8ghzmn6kkGh4PX2esXPM",[1747,1749],{"title":215,"path":216,"stem":217,"description":1748,"icon":218,"children":-1},"Validate request shape, domain rules, and storage invariants at the correct boundaries.",{"title":225,"path":226,"stem":227,"description":1750,"icon":228,"children":-1},"Use logs, metrics, traces, and profiles to understand a running service without guessing.",1794118102145]