Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Commit

Permalink
Fix gosec warning
Browse files Browse the repository at this point in the history
Signed-off-by: thepetk <[email protected]>
  • Loading branch information
thepetk committed Jun 1, 2023
1 parent 07104f6 commit e0bac85
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions go/pkg/apis/enricher/enricher.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ func GetDefaultProjectName(path string) string {
func GetPortsFromDockerFile(root string) []int {
locations := getLocations(root)
for _, location := range locations {
filePath := filepath.Join(root, filepath.Clean(location))
file, err := os.Open(filePath)
filePath := filepath.Join(root, location)
cleanFilePath := filepath.Clean(filePath)
file, err := os.Open(cleanFilePath)
if err == nil {
defer func() error {
if err := file.Close(); err != nil {
Expand Down

0 comments on commit e0bac85

Please sign in to comment.