Fix test: update test to comply with the spec of generated sources

https://pkg.go.dev/cmd/go#hdr-Generate_Go_files_by_processing_source says:

> This line must appear before the first non-comment, non-blank text in the file.

Original test cases fail with the previous commit because test source does not comply with this spec.
So, probably we should update test case to comply with the spec.
(This is a breaking change, though)
This commit is contained in:
nobishino 2024-03-07 22:37:59 +09:00 committed by Cosmin Cojocar
parent 3a0ea5176b
commit ccb0a08221

View file

@ -498,8 +498,8 @@ var _ = Describe("Analyzer", func() {
pkg := testutils.NewTestPackage() pkg := testutils.NewTestPackage()
defer pkg.Close() defer pkg.Close()
pkg.AddFile("foo.go", ` pkg.AddFile("foo.go", `
package foo
// Code generated some-generator DO NOT EDIT. // Code generated some-generator DO NOT EDIT.
package foo
func test() error { func test() error {
return nil return nil
} }
@ -541,8 +541,8 @@ var _ = Describe("Analyzer", func() {
pkg := testutils.NewTestPackage() pkg := testutils.NewTestPackage()
defer pkg.Close() defer pkg.Close()
pkg.AddFile("foo.go", ` pkg.AddFile("foo.go", `
package main
// Code generated some-generator DO NOT EDIT. // Code generated some-generator DO NOT EDIT.
package main
import ( import (
"fmt" "fmt"
) )