We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When trying to load config files, I'm getting this errors like this:
loader not found for file extension '..yml'
Here's the code in question:
package configuration import ( goConfig "github.com/pcelvng/go-config" "github.com/rs/zerolog/log" ) // Config is the main config type type Config struct { S3 S3Configuration `env:"S3" flag:"s3" validate:"required"` PublicFetchURL string `env:"PUBLIC_FETCH_URL" flag:"url" help:"The URL to fetch from instead of using the S3 API" validate:"omitempty,url"` SetPublicACL bool `env:"SET_PUBLIC_ACL" flag:"acl" help:"Whether or not to set a public read ACL on objects" validate:"omitempty"` DefaultCacheControl string `env:"CACHE_CONTROL" flag:"cache" help:"Cache-Control string to use" validate:"required"` } // S3Configuration is the S3 config type type S3Configuration struct { Endpoint string `env:"ENDPOINT" flag:"endpoint" help:"The S3 endpoint e.g. s3.amazonaws.com" validate:"required,fqdn"` Region string `env:"REGION" flag:"region" help:"The S3 region e.g. us-east-1" validate:"required"` Bucket string `env:"BUCKET" flag:"bucket" help:"The S3 bucket" validate:"required"` } // Configure loads the application configuration func Configure() Config { config := Config{ S3: S3Configuration{ Endpoint: "s3.amazonaws.com", Region: "us-east-1", }, SetPublicACL: false, DefaultCacheControl: "public, max-age=31536000", } if err := goConfig.Load(&config); err != nil { log.Fatal().Err(err).Msg("Error loading config") } return config }
And the command:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When trying to load config files, I'm getting this errors like this:
Here's the code in question:
And the command:
The text was updated successfully, but these errors were encountered: