Installation

Install godi

go get github.com/junioryono/godi/v5

Verify It Works

Create a file called main.go:

package main

import (
    "fmt"
    "github.com/junioryono/godi/v5"
)

func main() {
    services := godi.NewCollection()
    fmt.Println("godi is ready!")
}

Run it:

go run main.go

You should see:

godi is ready!

Requirements

  • Go 1.26+ - godi uses generics for type safety

  • No code generation - godi works at runtime, no build steps needed

  • No dependencies - the core library has zero external dependencies

Framework Integrations (Optional)

If you’re using a web framework, install the corresponding integration:

# For Gin
go get github.com/junioryono/godi/v5/gin

# For Chi
go get github.com/junioryono/godi/v5/chi

# For Echo
go get github.com/junioryono/godi/v5/echo

# For Fiber
go get github.com/junioryono/godi/v5/fiber

# For net/http
go get github.com/junioryono/godi/v5/http

Next: Create your first container