Skip to content

Commit b952b9b

Browse files
committed
fix: only continue when fileNotFound
1 parent 8d67388 commit b952b9b

File tree

1 file changed

+6
-1
lines changed
  • pkg/plugins/golang/v4/scaffolds

1 file changed

+6
-1
lines changed

pkg/plugins/golang/v4/scaffolds/api.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package scaffolds
1818

1919
import (
20+
"errors"
2021
"fmt"
2122

2223
"github.com/spf13/afero"
@@ -67,7 +68,11 @@ func (s *apiScaffolder) Scaffold() error {
6768
// Load the boilerplate
6869
boilerplate, err := afero.ReadFile(s.fs.FS, hack.DefaultBoilerplatePath)
6970
if err != nil {
70-
boilerplate = []byte("")
71+
if errors.Is(err, afero.ErrFileNotFound) {
72+
boilerplate = []byte("")
73+
} else {
74+
return fmt.Errorf("error scaffolding API/controller: unable to load boilerplate: %w", err)
75+
}
7176
}
7277

7378
// Initialize the machinery.Scaffold that will write the files to disk

0 commit comments

Comments
 (0)