Skip to content

Commit

Permalink
Ensures we add our own package to the imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmoran committed Sep 4, 2024
1 parent dd7d6f7 commit b14b23b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion parsing/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func Parse(path, name string) (Fake, error) {
return Fake{}, fmt.Errorf("failed to parse scope file: %w", err)
}

var imports []Import
imports := []Import{{Path: pkg.Path()}}
for _, i := range file.Imports {
buffer := bytes.NewBuffer(nil)

Expand Down
2 changes: 2 additions & 0 deletions parsing/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var _ = Describe("Parse", func() {
Expect(err).NotTo(HaveOccurred())
Expect(fake).To(Equal(parsing.Fake{
Imports: []parsing.Import{
{Name: "", Path: "io"},
{Name: "", Path: "errors"},
{Name: "", Path: "sync"},
},
Expand Down Expand Up @@ -52,6 +53,7 @@ var _ = Describe("Parse", func() {
Expect(err).NotTo(HaveOccurred())
Expect(fake).To(Equal(parsing.Fake{
Imports: []parsing.Import{
{Name: "", Path: "io"},
{Name: "", Path: "errors"},
{Name: "", Path: "sync"},
},
Expand Down

0 comments on commit b14b23b

Please sign in to comment.