Skip to content
Merged
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
4 changes: 2 additions & 2 deletions pkg/analyze/text_analyze.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package analyzer

import (
"path"
"path/filepath"
"regexp"
"strconv"
"strings"
Expand All @@ -11,7 +11,7 @@ import (
)

func analyzeTextAnalyze(analyzer *troubleshootv1beta1.TextAnalyze, getCollectedFileContents func(string) ([]byte, error)) (*AnalyzeResult, error) {
fullPath := path.Join(analyzer.CollectorName, analyzer.FileName)
fullPath := filepath.Join(analyzer.CollectorName, analyzer.FileName)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CodeLingoBot capture avoid path.Join
path.Join only works for paths separated by forward slashes. This can be problematic on Windows. Use filepath.Join to create paths in a way that is compatible with the target operating systems defined file paths.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rule captured at https://dash.codelingo.io/repos/replicatedhq/troubleshoot/rules/1403

CodeLingoBot Help

When responding to PR-level comments, I understand the following commands:

  • capture to capture the context for a fresh rule.

  • review to trigger a fresh review.

When responding to comments on specific lines of code, I understand the following commands:

  • capture to capture the context for a fresh rule.

  • review to trigger a fresh review.

  • ignore to ignore the parent review comment.

  • unignore to stop ignoring a parent review comment.

collected, err := getCollectedFileContents(fullPath)
if err != nil {
return nil, errors.Wrapf(err, "failed to read collected file name: %s", fullPath)
Expand Down