-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code changes to satisfy linters: - Ran `gofmt -s -w` on repo. - Broke up long lines. - When possible, changed names with incorrect initialism formatting - Added exceptions for exported variables. - Added exceptions for ALL_CAPS_WITH_UNDERSCORES code. - Switched to using `windows` or `syscall` definitions if possible; especially if some constants were unused. - Added `_ =` to satisfy error linter, and acknowledge that errors are being ignored. - Switched to using `errors.Is` and `As` in places, elsewhere added exceptions if error value was known to be `syscall.Errno`. - Removed bare returns. - Prevented variables from being overshadowed in certain places (ignoring cases of overshadowing `err`). - Renamed variables and functions (eg, `len`, `eventMetadata.bytes`) to prevent shadowing pre-built functions and imported pacakges. - Removed unused method receivers. - Added exceptions to certain unused (unexported) constants and functions. - Deleted unused `once` from `pkg/etw.providerMap`. - Renamed `noop.go` files to `main_other.go` or `doc.go`, to better fit style recommendations. - Added exceptions for non-secure use of SHA1 and weak crypto libraries. - Replaced `ioutil` with `io` and `os` (and `t.TempDir` in tests). - Added fully exhaustive checks for `switch` statements in `pkg/etw`. - Defined constant strings for `tools/mkwinsyscall`. - Removed unnecessary conversions. - Made sure `context.Cancel` was called. Additionally, added `//go:build windows" constraints on files with unexported code, since linter will complain about unused code on non-Windows platforms. Added a stub `main() {}` for `mkwinsyscall` for non-Windows builds, just in case `//go:generate` directives are added to OS-agnostic files. Signed-off-by: Hamza El-Saawy <[email protected]>
- Loading branch information
Showing
60 changed files
with
824 additions
and
567 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
// +build !windows | ||
// This file only exists to allow go get on non-Windows platforms. | ||
|
||
package backuptar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//go:build windows | ||
|
||
package backuptar | ||
|
||
import ( | ||
|
Oops, something went wrong.