Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Joan López de la Franca Beltran <[email protected]>
  • Loading branch information
mstoykov and joanlopez authored Apr 22, 2024
1 parent 0a37d2d commit 872ce2c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions js/modules/require_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ func (r *LegacyRequireImpl) warnUserOnPathResolutionDifferences(specifier string
if err != nil {
logger.Warningf("Couldn't get the \"correct\" path to resolve specifier %q against: %q"+
"Please report to issue %s. "+
"This will not currently break your script but might mean the future it won't work",
"This will not currently break your script but it might mean that in the future it won't work",
specifier, err, issueLink)
} else if r.currentlyRequiredModule.String() != correct.String() {
logger.Warningf("The \"wrong\" path (%q) and the actually used by k6 path (%q) to resolve %q are different. "+
logger.Warningf("The \"wrong\" path (%q) and the path actually used by k6 (%q) to resolve %q are different. "+
"Please report to issue %s. "+
"This will not currently break your script but *WILL* in the future, please report this!!!",
correct, r.currentlyRequiredModule, specifier, issueLink)
Expand All @@ -103,23 +103,23 @@ func (r *LegacyRequireImpl) warnUserOnPathResolutionDifferences(specifier string
if err != nil {
logger.Warningf("Couldn't get the \"wrong\" path to resolve specifier %q against: %q"+
"Please report to issue %s. "+
"This will not currently break your script but might mean the future it won't work",
"This will not currently break your script but it might mean that in the future it won't work",
specifier, err, issueLink)
return
}
k6behaviour, err := normalizePathToURL(k6behaviourString)
if err != nil {
logger.Warningf("Couldn't get the \"wrong\" path to resolve specifier %q against: %q"+
"Please report to issue %s. "+
"This will not currently break your script but might mean the future it won't work",
"This will not currently break your script but it might mean that in the future it won't work",
specifier, err, issueLink)
return
}
if r.currentlyRequiredModule.String() != k6behaviour.String() {
// this should always be equal, but check anyway to be certain we won't break something
logger.Warningf("The \"wrong\" path (%q) and the actually used by k6 path (%q) to resolve %q are different. "+
logger.Warningf("The \"wrong\" path (%q) and the path actually used by k6 (%q) to resolve %q are different. "+
"Please report to issue %s. "+
"This will not currently break your script but might mean the future it won't work",
"This will not currently break your script but it might mean that in the future it won't work",
k6behaviour, r.currentlyRequiredModule, specifier, issueLink)
}
}
Expand Down

0 comments on commit 872ce2c

Please sign in to comment.