@@ -63,7 +63,7 @@ type DeployObserver interface {
63
63
}
64
64
65
65
type DeployWarner interface {
66
- OnWalkWarning (string )
66
+ OnWalkWarning (path , msg string )
67
67
}
68
68
69
69
// DeployOptions holds the option for creating a new deploy
@@ -591,9 +591,7 @@ func bundle(functionDir string, observer DeployObserver) (*deployFiles, error) {
591
591
functions .Add (file .Name , file )
592
592
default :
593
593
if warner , ok := observer .(DeployWarner ); ok {
594
- warner .OnWalkWarning (
595
- fmt .Sprintf ("Function \" %s\" is not valid for deployment. Please check that it matches the format for the runtime." , filePath ),
596
- )
594
+ warner .OnWalkWarning (filePath , "Function is not valid for deployment. Please check that it matches the format for the runtime." )
597
595
}
598
596
}
599
597
}
@@ -668,22 +666,22 @@ func goFile(filePath string, i os.FileInfo, observer DeployObserver) bool {
668
666
669
667
if m := i .Mode (); m & 0111 == 0 { // check if it's an executable file
670
668
if hasWarner {
671
- warner .OnWalkWarning (fmt . Sprintf ( "%s: Go binary does not have executable permissions", filePath ) )
669
+ warner .OnWalkWarning (filePath , " Go binary does not have executable permissions" )
672
670
}
673
671
return false
674
672
}
675
673
676
674
if _ , err := elf .Open (filePath ); err != nil { // check if it's a linux executable
677
675
if hasWarner {
678
- warner .OnWalkWarning (fmt . Sprintf ( "%s: Go binary is not a linux executable", filePath ) )
676
+ warner .OnWalkWarning (filePath , " Go binary is not a linux executable" )
679
677
}
680
678
return false
681
679
}
682
680
683
681
v , err := version .ReadExe (filePath )
684
682
if err != nil || ! strings .HasPrefix (v .Release , "go1." ) {
685
683
if hasWarner {
686
- warner .OnWalkWarning (fmt . Sprintf ( "%s: Unable to detect Go version 1.x", filePath ) )
684
+ warner .OnWalkWarning (filePath , " Unable to detect Go version 1.x" )
687
685
}
688
686
}
689
687
0 commit comments