Skip to content

Commit

Permalink
fixed filepath generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Code-Hex authored and StevenACoffman committed Feb 28, 2022
1 parent 571b374 commit 818cbea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugin/modelgen/models_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"go/ast"
"go/parser"
"go/token"
"io/fs"
"io/ioutil"
"path/filepath"
"strings"
"testing"

Expand Down Expand Up @@ -95,7 +95,8 @@ func TestModelGeneration(t *testing.T) {
pkg, err := parseAst("out")
require.NoError(t, err)

generated := pkg.Files["out/generated.go"]
path := filepath.Join("out", "generated.go")
generated := pkg.Files[path]

type field struct {
typ string
Expand Down Expand Up @@ -191,7 +192,7 @@ func mutateHook(b *ModelBuild) *ModelBuild {
func parseAst(path string) (*ast.Package, error) {
// test setup to parse the types
fset := token.NewFileSet()
pkgs, err := parser.ParseDir(fset, path, func(fs.FileInfo) bool { return true }, parser.AllErrors)
pkgs, err := parser.ParseDir(fset, path, nil, parser.AllErrors)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 818cbea

Please sign in to comment.