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
also, this is separate but how do we feel about using a struct instead of this global variable?
like, instead of this:
var ( runtimeAPI = os.Getenv("AWS_LAMBDA_RUNTIME_API") extensionName = filepath.Base(os.Args[0]) isFirstInvocation = true runtimeDone = make(chan struct{}) // API Port logsPort = "8080" // Buffering Config defaultMaxItems = 1000 defaultMaxBytes = 262144 defaultTimeoutMS = 1000 developmentMode = false logger *zap.Logger )
something more like:
type Config struct { RuntimeAPI string ExtensionName string IsFirstInvocation bool LogsPort string MaxItems int MaxBytes int TimeoutMS int DevelopmentMode bool Logger *zap.Logger RuntimeDone chan struct{} } var cfg = Config{ RuntimeAPI: os.Getenv("AWS_LAMBDA_RUNTIME_API"), ExtensionName: filepath.Base(os.Args[0]), IsFirstInvocation: true, LogsPort: "8080", MaxItems: 1000, MaxBytes: 262144, TimeoutMS: 1000, DevelopmentMode: false, RuntimeDone: make(chan struct{}), }
and then used like
cfg.Logger.Error('ex')
Originally posted by @flbn in #17 (comment)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
like, instead of this:
something more like:
and then used like
Originally posted by @flbn in #17 (comment)
The text was updated successfully, but these errors were encountered: