{"id":69898,"library":"sarulabs-di","title":"Sarulabs DI","description":"A dependency injection container for Go applications.","status":"active","version":"2.0.0+incompatible","language":"go","source_language":null,"source_url":"https://github.com/sarulabs/di","tags":["dependency-injection","container","ioc"],"install":[{"cmd":"go get github.com/sarulabs/di","lang":"bash","label":"Install github.com/sarulabs/di"}],"dependencies":[],"imports":[{"symbol":"di","correct":"github.com/sarulabs/di"}],"quickstart":{"code":"package main\n\nimport (\n\t\"fmt\"\n\t\"github.com/sarulabs/di\"\n)\n\nfunc main() {\n\tcontainer, _ := di.New()\n\tcontainer.Register(di.Def{\n\t\tName: \"greeter\",\n\t\tBuild: func(ctn di.Container) (interface{}, error) {\n\t\t\treturn \"Hello, World!\", nil\n\t\t},\n\t})\n\tgreeter, _ := container.Get(\"greeter\")\n\tfmt.Println(greeter.(string))\n}","lang":"go","description":"Creates a DI container, registers a service, and retrieves it."},"warnings":[{"fix":"Use 'github.com/sarulabs/di' for v2 (note the 'v2' tag) or 'gopkg.in/sarulabs/di.v1' for v1.","message":"Version 2.0.0+incompatible uses a different import path than v1; ensure you use the correct module path.","severity":"breaking","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'applic':9 'contain':6,13 'depend':4,11 'dependency-inject':10 'di':2 'go':8 'inject':5,12 'ioc':14 'sarulab':1","created_at":"2026-06-17T18:07:04.618424+00:00","updated_at":"2026-06-17T18:07:04.618424+00:00","problems":[],"ecosystem":"go","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/sarulabs/di","github":"https://github.com/sarulabs/di","docs":"https://pkg.go.dev/github.com/sarulabs/di#section-documentation","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-12-14","install_tag":null}}