[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"academy-blogs-en-1-1-all-js2go-ep47-dependency-injection-go-nodejs-en-all--*":3,"academy-blog-translations-qo0d0sbi306ytfv":75},{"data":4,"page":74,"perPage":74,"totalItems":74,"totalPages":74},[5],{"alt":6,"collectionId":7,"collectionName":8,"content":9,"cover_image":10,"cover_image_path":11,"created":12,"created_by":13,"expand":14,"id":69,"keywords":70,"locale":44,"published_at":71,"scheduled_at":13,"school_blog":66,"short_description":72,"status":64,"title":6,"updated":73,"updated_by":13,"slug":67,"views":68},"JS2GO EP.47 Dependency Injection in Go and Node.js: Why Large Systems Need DI","sclblg987654321","school_blog_translations","\u003Cp>Dependency Injection (DI) is one of the most important architectural techniques behind enterprise-level systems whether you’re building APIs, microservices, or large-scale platforms.\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>DI helps your codebase become:\u003C\u002Fp>\u003Cp>✔ 10× easier to test (because every dependency can be mocked)\u003Cbr>✔ Less complex with fewer bugs caused by global state\u003Cbr>✔ Cleaner separation of concerns\u003Cbr>✔ Flexible—you can swap implementations without breaking the system\u003Cbr>✔ Maintainable, with a clear and predictable dependency graph\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>In simple terms: DI = Passing dependencies into a class\u002Fmodule\u002Fservice instead of creating them inside.\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch2>⭐ 1) Why Does DI Make Systems So Much More Testable?\u003C\u002Fh2>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>❌ Anti-pattern: Creating dependencies inside the service\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-go\">type UserService struct {\n    repo *UserRepository\n}\n\nfunc NewUserService() *UserService {\n    return &amp;UserService{\n        repo: NewUserRepository(), \u002F\u002F Hard-coded dependency\n    }\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>🔥 Problems:\u003C\u002Fp>\u003Cul>\u003Cli>Cannot test without a real database\u003C\u002Fli>\u003Cli>Cannot mock the repository\u003C\u002Fli>\u003Cli>Forces a single implementation → tightly coupled\u003C\u002Fli>\u003Cli>Hard to maintain and scale\u003C\u002Fli>\u003C\u002Ful>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>✔ Correct pattern: Inject dependencies from outside\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-go\">type UserService struct {\n    repo UserRepository\n}\n\nfunc NewUserService(repo UserRepository) *UserService {\n    return &amp;UserService{repo: repo}\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>🎉 Benefits:\u003C\u002Fp>\u003Cul>\u003Cli>Easy unit testing (no real DB needed)\u003C\u002Fli>\u003Cli>Swap implementations freely → pg → mongo → mock\u003C\u002Fli>\u003Cli>Reduced coupling → much easier long-term maintenance\u003C\u002Fli>\u003C\u002Ful>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>DI is the foundation of testable architecture.\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch2>⭐ 2) Constructor-based DI in Go (Production Standard)\u003C\u002Fh2>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>Go does not require a DI framework.\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>Instead, the Go community embraces constructor injection, which is:\u003C\u002Fp>\u003Cul>\u003Cli>simple\u003C\u002Fli>\u003Cli>explicit\u003C\u002Fli>\u003Cli>debuggable\u003C\u002Fli>\u003Cli>perfect for Clean Architecture\u003C\u002Fli>\u003C\u002Ful>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🎯 Interface = Dependency Contract\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-go\">type UserRepository interface {\n    FindByID(id string) (*User, error)\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🎯 Implementation (PostgreSQL Repository)\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-go\">type PgUserRepository struct {\n    db *pgxpool.Pool\n}\n\nfunc (r *PgUserRepository) FindByID(id string) (*User, error) {\n    var u User\n    err := r.db.QueryRow(context.Background(),\n        \"SELECT id, name FROM users WHERE id=$1\", id).\n        Scan(&amp;u.ID, &amp;u.Name)\n    return &amp;u, err\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🎯 Service Layer\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-go\">type UserService struct {\n    repo UserRepository\n}\n\nfunc NewUserService(repo UserRepository) *UserService {\n    return &amp;UserService{repo: repo}\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🎯 Handler Layer\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-go\">type UserHandler struct {\n    service *UserService\n}\n\nfunc NewUserHandler(s *UserService) *UserHandler {\n    return &amp;UserHandler{s}\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🎯 Build the Dependency Graph\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-go\">func BuildUserModule(db *pgxpool.Pool) *UserHandler {\n    repo := &amp;PgUserRepository{db: db}\n    service := NewUserService(repo)\n    handler := NewUserHandler(service)\n    return handler\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>This is Pure DI clean, explicit, and magic-free.\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch2>⭐ 3) DI Container in Node.js (Express, NestJS, Awilix)\u003C\u002Fh2>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>In the Node.js ecosystem, DI containers are widely used:\u003C\u002Fp>\u003Cul>\u003Cli>Awilix (most popular for Express)\u003C\u002Fli>\u003Cli>Tsyringe\u003C\u002Fli>\u003Cli>InversifyJS\u003C\u002Fli>\u003Cli>NestJS (built-in DI system)\u003C\u002Fli>\u003C\u002Ful>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🟧 Example: DI Using Awilix (Express)\u003C\u002Fh3>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch4>Install packages\u003C\u002Fh4>\u003Cpre>\u003Ccode class=\"language-plaintext language-bash\">npm install awilix awilix-express\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch4>Create the container\u003C\u002Fh4>\u003Cpre>\u003Ccode class=\"language-plaintext language-js\">import { createContainer, asClass } from \"awilix\";\n\nconst container = createContainer();\n\ncontainer.register({\n  userRepository: asClass(UserRepository),\n  userService: asClass(UserService),\n  userController: asClass(UserController)\n});\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch4>Use it in Express\u003C\u002Fh4>\u003Cpre>\u003Ccode class=\"language-plaintext language-js\">import { scopePerRequest } from \"awilix-express\";\napp.use(scopePerRequest(container));\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>Awilix injects dependencies automatically per request.\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch2>⭐ 4) Mocking Repositories &amp; Services for Easy Testing\u003C\u002Fh2>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🟦 Go Mock Repository\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-go\">type MockUserRepo struct {\n    data map[string]User\n}\n\nfunc (m *MockUserRepo) FindByID(id string) (*User, error) {\n    if u, ok := m.data[id]; ok {\n        return &amp;u, nil\n    }\n    return nil, errors.New(\"not found\")\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch4>Unit Test\u003C\u002Fh4>\u003Cpre>\u003Ccode class=\"language-plaintext language-go\">repo := &amp;MockUserRepo{data: map[string]User{\n    \"1\": {ID: \"1\", Name: \"Ploy\"},\n}}\n\nservice := NewUserService(repo)\nuser, _ := service.GetUser(\"1\")\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>✔ No DB required\u003Cbr>✔ Fast and deterministic\u003Cbr>✔ Perfect for unit testing\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🟧 Node.js Mock Repository\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-js\">const mockRepo = {\n  findById: async (id) =&gt; ({ id, name: \"Ploy\" })\n};\n\nconst service = new UserService(mockRepo);\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>The test becomes isolated and predictable.\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch2>⭐ 5) Designing a Correct Dependency Graph\u003C\u002Fh2>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>Golden Rules:\u003C\u002Fp>\u003Cpre>\u003Ccode class=\"language-plaintext\">Controller → Service → Repository → Database\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cul>\u003Cli>Controllers must NOT touch the database directly\u003C\u002Fli>\u003Cli>Services must NOT instantiate dependencies\u003C\u002Fli>\u003Cli>Repositories must NOT contain business logic\u003C\u002Fli>\u003Cli>No circular dependencies\u003C\u002Fli>\u003C\u002Ful>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>Example Dependency Graph\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext\">HTTP Handler\n     ↓\nService Layer\n     ↓\nRepository Layer\n     ↓\nDatabase\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>Large systems extend this pattern:\u003C\u002Fp>\u003Cpre>\u003Ccode class=\"language-plaintext\">OrderAPI → OrderService → OrderRepo → PostgreSQL\n                    ↑\n              PaymentService → PaymentGateway\n                    ↑\n             InventoryService → InventoryRepo\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>DI keeps the entire graph clear and maintainable.\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch2>⭐ 6) Best Practices (Go + Node.js)\u003C\u002Fh2>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>✔ Prefer constructor injection\u003Cbr>✔ Use interfaces (Go) or abstractions (JS)\u003Cbr>✔ Avoid global state\u003Cbr>✔ Use DI container only when necessary\u003Cbr>✔ Mock dependencies in all unit tests\u003Cbr>✔ Keep config separate from domain logic\u003Cbr>✔ Dependency flow must be one direction (no cycles)\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Chr>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch2>📌 Summary\u003C\u002Fh2>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>Dependency Injection is not for large corporations only. It is a fundamental skill every backend developer must master.\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>DI allows your system to be:\u003C\u002Fp>\u003Cp>🚀 Easy to test\u003Cbr>🧱 Low-coupled\u003Cbr>🔄 Flexible to change\u003Cbr>🔍 Easy to debug\u003Cbr>📦 Scalable for real production workloads\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>Go → Constructor Injection = best practice\u003C\u002Fp>\u003Cp>Node.js → Awilix \u002F NestJS for powerful DI\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>A clean DI + dependency graph = a system truly ready for Production-scale growth.\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch2>🔵 Coming Next: EP.48 Logging &amp; Monitoring for Production\u003C\u002Fh2>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>You will learn:\u003C\u002Fp>\u003Cul>\u003Cli>Structured Logging (Zap, Zerolog, Pino)\u003C\u002Fli>\u003Cli>Distributed Tracing (OpenTelemetry)\u003C\u002Fli>\u003Cli>Metrics (Prometheus + Grafana)\u003C\u002Fli>\u003Cli>Error Monitoring (Sentry)\u003C\u002Fli>\u003Cli>Correlation IDs for microservices\u003C\u002Fli>\u003C\u002Ful>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cdiv class=\"raw-html-embed\">\u003Cdiv style=\"margin:0 0 6px 0; font-weight:700;\">Read more:\u003C\u002Fdiv>\n\u003Cul style=\"list-style:none; padding:0; margin:0; line-height:1.4;\">\n  \u003Cli style=\"margin:0;\">\u003Ca href=\"\u002Fen\u002Fblogs\u002Fcategories\u002FGolang\" title=\"Golang The Series\">Golang The Series\u003C\u002Fa>\u003C\u002Fli>\n  \u003Cli style=\"margin:0;\">\u003Ca href=\"\u002Fen\u002Fblogs\u002Fcategories\u002FJS2GO\" title=\"JS2GO\">JS2GO\u003C\u002Fa>\u003C\u002Fli>\n  \u003Cli style=\"margin:0;\">\u003Ca href=\"\u002Fen\u002Fblogs\u002Fcategories\u002FTailwind%20CSS\" title=\"Tailwind CSS\">Tailwind CSS\u003C\u002Fa>\u003C\u002Fli>\n\u003C\u002Ful>\u003C\u002Fdiv>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cdiv class=\"raw-html-embed\">\n  \u003Cp style=\"margin:0 0 6px 0;\">\u003Cstrong>Follow Us:\u003C\u002Fstrong>\u003C\u002Fp>\n  \u003Cul style=\"list-style:none; padding:0; margin:0; line-height: 0.4;\">\n    \u003Cli style=\"display:flex; align-items:center; gap:6px; margin:0;\">\n      \n      \u003Csvg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"#1877F2\" aria-hidden=\"true\">\n        \u003Cpath d=\"M22 12.07C22 6.48 17.52 2 11.93 2S2 6.48 2 12.07c0 5 3.66 9.14 8.44 9.93v-7.02H7.9v-2.91h2.54V9.41c0-2.5 1.49-3.88 3.77-3.88 1.09 0 2.24.2 2.24.2v2.46h-1.26c-1.24 0-1.63.77-1.63 1.56v1.87h2.78l-.44 2.91h-2.34V22c4.78-.79 8.44-4.93 8.44-9.93Z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Ca href=\"https:\u002F\u002Fwww.facebook.com\u002Fsuperdev.academy.th\" target=\"_blank\" rel=\"noopener\" title=\"Follow Superdev Academy on Facebook\">Facebook: Superdev Academy\u003C\u002Fa>\n    \u003C\u002Fli>\n\n    \u003Cli style=\"display:flex; align-items:center; gap:6px; margin:0;\">\n      \n      \u003Csvg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"#FF0000\" aria-hidden=\"true\">\n        \u003Cpath d=\"M23.5 6.2a3 3 0 0 0-2.1-2.1C19.5 3.5 12 3.5 12 3.5s-7.5 0-9.4.6A3 3 0 0 0 .5 6.2 31.5 31.5 0 0 0 0 12a31.5 31.5 0 0 0 .5 5.8 3 3 0 0 0 2.1 2.1c1.9.6 9.4.6 9.4.6s7.5 0 9.4-.6a3 3 0 0 0 2.1-2.1A31.5 31.5 0 0 0 24 12a31.5 31.5 0 0 0-.5-5.8ZM9.75 15.02V8.98L15.5 12l-5.75 3.02Z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Ca href=\"https:\u002F\u002Fwww.youtube.com\u002F@SuperdevAcademy\" target=\"_blank\" rel=\"noopener\" title=\"Watch on YouTube\">YouTube: Superdev Academy\u003C\u002Fa>\n    \u003C\u002Fli>\n\n    \u003Cli style=\"display:flex; align-items:center; gap:6px; margin:0;\">\n      \n      \u003Csvg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"#E4405F\" aria-hidden=\"true\">\n        \u003Cpath d=\"M7 2h10a5 5 0 0 1 5 5v10a5 5 0 0 1-5 5H7a5 5 0 0 1-5-5V7a5 5 0 0 1 5-5Zm10 2H7a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3Zm-5 3.5A5.5 5.5 0 1 1 6.5 13 5.5 5.5 0 0 1 12 7.5Zm0 2A3.5 3.5 0 1 0 15.5 13 3.5 3.5 0 0 0 12 9.5Zm5.75-2.75a1.25 1.25 0 1 1-1.25 1.25 1.25 1.25 0 0 1 1.25-1.25Z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Ca href=\"https:\u002F\u002Fwww.instagram.com\u002Fsuperdevacademy\u002F?hl=en target=\" _blank\"=\"\" rel=\"noopener\" title=\"See behind-the-scenes on Instagram\">Instagram: Superdev Academy\u003C\u002Fa>\n    \u003C\u002Fli>\n\n    \u003Cli style=\"display:flex; align-items:center; gap:6px; margin:0;\">\n      \n      \u003Csvg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"#000000\" aria-hidden=\"true\">\n        \u003Cpath d=\"M21 8.12a6.86 6.86 0 0 1-4.8-2V16a6 6 0 1 1-6-6 5.9 5.9 0 0 1 1.63.23V8.05a9.08 9.08 0 0 1-1.63-.15V4.5a6.86 6.86 0 0 0 4.8 2.05V6.5a6.86 6.86 0 0 0 4.8 1.62ZM9.2 12.5A3.5 3.5 0 1 0 12.7 16V9.94a6 6 0 0 1-1.63-.27v3.95a3.5 3.5 0 0 1-1.87 3.17 3.5 3.5 0 0 1-4.78-3.23 3.5 3.5 0 0 1 4.78-3.06Z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Ca href=\"https:\u002F\u002Fwww.tiktok.com\u002F@superdevacademy\" target=\"_blank\" rel=\"noopener\" title=\"Watch short tips on TikTok\">TikTok: @superdevacademy\u003C\u002Fa>\n    \u003C\u002Fli>\n\n    \u003Cli style=\"display:flex; align-items:center; gap:6px; margin:0;\">\n      \n      \u003Csvg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"#111827\" aria-hidden=\"true\">\n        \u003Cpath d=\"M12 2a10 10 0 1 0 10 10A10.01 10.01 0 0 0 12 2Zm6.93 6h-3.26a15.6 15.6 0 0 0-1.39-3.62A8.03 8.03 0 0 1 18.93 8ZM12 4c.73.93 1.7 2.74 2.2 4H9.8C10.3 6.74 11.27 4.93 12 4ZM8.72 4.38A15.6 15.6 0 0 0 7.32 8H4.07a8.03 8.03 0 0 1 4.65-3.62ZM4.07 16h3.25a15.6 15.6 0 0 0 1.4 3.62A8.03 8.03 0 0 1 4.07 16ZM12 20c-.73-.93-1.7-2.74-2.2-4h4.4C13.7 17.26 12.73 19.07 12 20Zm3.28-.38A15.6 15.6 0 0 0 16.68 16h3.25a8.03 8.03 0 0 1-4.65 3.62ZM20 14h-3.54a13.8 13.8 0 0 1-.26-4H20a7.98 7.98 0 0 1 0 4Zm-12.2 0H4a7.98 7.98 0 0 1 0-4h3.54a13.8 13.8 0 0 1-.26 4Zm2 .5h4.4a17.8 17.8 0 0 1-.72-4.5c0-1.58.25-3.1.72-4.5H9.8a17.8 17.8 0 0 1 .72 4.5c0 1.58-.25 3.1-.72 4.5Z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Ca href=\"https:\u002F\u002Fwww.superdevacademy.com\u002F\" target=\"_blank\" rel=\"noopener\" title=\"Visit the official website of Superdev Academy\">Official Website: Superdev Academy.com\u003C\u002Fa>\n    \u003C\u002Fli>\n  \u003C\u002Ful>\n\u003C\u002Fdiv>\u003Cp>&nbsp;\u003C\u002Fp>","cover_image_js2_go_ep_47_dependency_injection_in_go_and_node_iuyyactaxs.geSystemsNeedDI.webp","https:\u002F\u002Ftwsme-r2.tumwebsme.com\u002Fsclblg987654321\u002Fg72uu715esxebkw\u002Fcover_image_js2_go_ep_47_dependency_injection_in_go_and_node_iuyyactaxs.geSystemsNeedDI.webp","2026-03-04 08:45:02.477Z","",{"keywords":15,"locale":38,"school_blog":48},[16,23,28,33],{"collectionId":17,"collectionName":18,"created":19,"created_by":13,"id":20,"name":21,"updated":22,"updated_by":13},"sclkey987654321","school_keywords","2026-03-04 08:45:01.083Z","anx8rod7y41shjl","Clean Architecture","2026-04-10 16:12:53.282Z",{"collectionId":17,"collectionName":18,"created":24,"created_by":13,"id":25,"name":26,"updated":27,"updated_by":13},"2026-03-04 08:24:40.405Z","05u3tysava2z6ga","Node.js","2026-04-10 16:07:29.504Z",{"collectionId":17,"collectionName":18,"created":29,"created_by":13,"id":30,"name":31,"updated":32,"updated_by":13},"2026-03-04 08:20:11.547Z","ey3puyme01a9bsw","Go","2026-04-10 16:07:25.893Z",{"collectionId":17,"collectionName":18,"created":34,"created_by":13,"id":35,"name":36,"updated":37,"updated_by":13},"2026-03-04 08:45:01.460Z","bbwe2jz83qa1d1j","Dependency Injection","2026-04-10 16:12:53.456Z",{"code":39,"collectionId":40,"collectionName":41,"created":42,"flag":43,"id":44,"is_default":45,"label":46,"updated":47},"en","pbc_1989393366","locales","2026-01-22 11:00:02.726Z","twemoji:flag-united-states","qv9c1llfov2d88z",false,"English","2026-04-10 15:42:46.825Z",{"category":49,"collectionId":50,"collectionName":51,"created":13,"expand":52,"id":66,"slug":67,"updated":13,"views":68},"hsa1afr8fcnd6qb","pbc_2105096300","school_blogs",{"category":53},{"blogIds":54,"collectionId":55,"collectionName":56,"created":57,"created_by":13,"id":49,"image":58,"image_alt":13,"image_path":59,"label":60,"name":61,"priority":62,"publish_at":63,"scheduled_at":13,"status":64,"updated":65,"updated_by":13},[],"sclcatblg987654321","school_category_blogs","2026-03-04 08:24:37.986Z","js2_go_2_11zon_y6paxmuz32.webp","https:\u002F\u002Ftwsme-r2.tumwebsme.com\u002Fsclcatblg987654321\u002Fhsa1afr8fcnd6qb\u002Fjs2_go_2_11zon_y6paxmuz32.webp",{"en":61,"th":61},"JS2GO",10,"2025-08-11 03:41:08.820Z","published","2026-04-25 02:32:14.339Z","qo0d0sbi306ytfv","js2go-ep47-dependency-injection-go-nodejs-en",207,"g72uu715esxebkw",[20,25,30,35],"2025-12-17 02:26:07.719Z","Dependency Injection (DI) makes systems more testable, maintainable, and scalable. This article explains DI concepts, constructor-based injection in Go, DI containers in Node.js, mock-based testing, and how DI enables clean system architecture suitable.","2026-05-08 06:52:02.057Z",1,{"th":67,"en":67}]