leonidasdeim / cog

⚙️ Configuration library for Go applications

Home Page:https://pkg.go.dev/github.com/leonidasdeim/cog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'defaults' functionality does not work on nested fields

leonidasdeim opened this issue · comments

type Type struct {
	AppName    string     `json:"name" validate:"required"`
	Version    string     `json:"version" validate:"required"`
	Store      Connection `json:"store" validate:"required"`
}

type Connection struct {
	User     string `json:"user"`
	Password string `json:"password"`
	Host     string `json:"host" default:”localhost”`
	Port     string `json:"port" default:”123”`
}

If not provided Type.Connection.Host should be set to default value

This PR #16 should fix this issue