* request a port when not port given * make context an interface, for easy testing (#380)
14 lines
279 B
Go
14 lines
279 B
Go
package handlers
|
|
|
|
import (
|
|
"github.com/metrue/fx/config"
|
|
"github.com/metrue/fx/context"
|
|
)
|
|
|
|
// UseInfra use infra
|
|
func UseInfra(ctx context.Contexter) error {
|
|
fxConfig := ctx.Get("config").(*config.Config)
|
|
cli := ctx.GetCliContext()
|
|
return fxConfig.Use(cli.Args().First())
|
|
}
|