Skip to content
New issue

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

refactor: remove unnecessary type conversions #333

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ linters:
- testifylint
# - thelper
# - tparallel
# - unconvert
- unconvert
# - unparam
# - unused
# - usestdlibvars
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ func runcInitPid(scanRoot string, runtimeName string, id string) int {
return -1
}
var grpcContainerStatus map[string]*json.RawMessage
if err := json.Unmarshal([]byte(statusContent), &grpcContainerStatus); err != nil {
if err := json.Unmarshal(statusContent, &grpcContainerStatus); err != nil {
log.Errorf("Can't unmarshal status for container %v , error: %v", id, err)
return -1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func createFileFromTestData(t *testing.T, root string, subPath string, fileName
if err != nil {
t.Fatalf("read from %s: %v\n", testDataFilePath, err)
}
err = os.WriteFile(filepath.Join(root, subPath, fileName), []byte(testData), 0644)
err = os.WriteFile(filepath.Join(root, subPath, fileName), testData, 0644)
if err != nil {
t.Fatalf("write to %s: %v\n", filepath.Join(root, subPath, fileName), err)
}
Expand Down
2 changes: 1 addition & 1 deletion extractor/standalone/windows/dismpatch/dismpatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

// inventoryFromOutput parses the output of DISM and produces inventory entries from it.
func inventoryFromOutput(flavor, output string) ([]*extractor.Inventory, error) {
packages, imgVersion, err := dismparser.Parse(string(output))
packages, imgVersion, err := dismparser.Parse(output)
if err != nil {
return nil, err
}
Expand Down
Loading