File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package files
22
33import (
44 "os"
5+ "path"
56 "path/filepath"
67
78 "github.com/pkg/errors"
@@ -25,7 +26,7 @@ func (f Files) ReadSolutionFiles(trainingRootFs afero.Fs, dir string) ([]*genpro
2526 if info .IsDir () {
2627 return nil
2728 }
28- if filepath . Ext (info . Name ()) != ".go" && info . Name () != "go.mod" {
29+ if ! isSolutionFile (info ) {
2930 return nil
3031 }
3132
@@ -60,3 +61,20 @@ func (f Files) ReadSolutionFiles(trainingRootFs afero.Fs, dir string) ([]*genpro
6061
6162 return files , nil
6263}
64+
65+ func isSolutionFile (info os.FileInfo ) bool {
66+ if filepath .Ext (info .Name ()) == ".go" {
67+ return true
68+ }
69+ if info .Name () == "go.mod" {
70+ return true
71+ }
72+ if info .Name () == "go.work" {
73+ return true
74+ }
75+ if path .Ext (info .Name ()) != ".sql" {
76+ return true
77+ }
78+
79+ return false
80+ }
You can’t perform that action at this time.
0 commit comments