Skip to content

shu-go/findcfg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Package findcfg finds a config file.

Go Report Card MIT License

An example

// finder for a YAML file in os.Executable() and os.UserConfigDir()+myapp
finder := findcfg.New( // config.yaml
    findcfg.Name("config"),
    findcfg.YAML(),
    findcfg.ExecutableDir(),
    findcfg.UserConfigDir("myapp"),
)

if found := finder.Find(); found != nil {
	return found.Path
}

return finder.FallbackPath()

go get

go get -u github.com/shu-go/findcfg

Copyright 2024 Shuhei Kubota

About

Package findcfg finds a config file.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages