You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit addresses a large number of golangci-lint warnings across
the codebase. The fixes span multiple categories of linters.
Key changes include:
- Error Handling: Ensured that all error return values are checked,
particularly from `io.Copy` and `flag.Value.Set`.
- Code Formatting: Corrected formatting issues with `gofumpt`.
- Vet and Staticcheck:
- Resolved a potential context leak in the GCS output by
ensuring the cancel function is always called.
- Replaced deprecated `io/ioutil` with `io` and `os` packages.
- Replaced deprecated `zap.OnFatal` with `zap.WithFatalHook`.
- Fixed an issue in TCP and TLS outputs where the write buffer was being
modified, which is unsafe. A new buffer is now used.
- Simplified various struct field selectors and boolean expressions.
- Revive Linter:
- Added comments to numerous exported functions, types, and methods to improve documentation.
- Removed unused function parameters and variables.
- Corrected function signatures to place `context.Context` as the first argument.
- Code Organization:
- Added package-level comments to all packages.
- Renamed the `internal/output/tls` and `internal/output/udp` packages to match their dir names.
- Added go-licenser and golangci-lint as go.mod tool dependencies. Removed tools.go.
The only remaining linter warning is for the TODO in the udp output.
rootCmd.PersistentFlags().StringVar(&opts.GcsOptions.ObjectContentType, "gcs-content-type", "application/json", "The Content type of the object to be uploaded to GCS.")
rootCmd.PersistentFlags().StringVar(&opts.GCSOptions.ObjectContentType, "gcs-content-type", "application/json", "The Content type of the object to be uploaded to GCS.")
rootCmd.PersistentFlags().BoolVar(&opts.LumberjackOptions.ParseJSON, "lumberjack-parse-json", false, "Parse the input data as JSON and send the structured data as a Lumberjack batch.")
0 commit comments