Open buddy-sandidge opened 2 years ago
Running pkger 1.17.1 will error when running on Go 1.18 code that uses type parameters/generics. An example can be found in this gist.
pkger
$ pkger 2022/03/30 13:10:19 /tmp/pkger-test/main.go:10:13: expected '(', found '[' (and 5 more errors): ParseDir failed /tmp/pkger-test: /tmp/pkger-test
An example of Go code that will cause the error.
package main import ( "io" "os" "github.com/markbates/pkger" ) func Example[T any]() {} func main() { f, err := pkger.Open("/file.txt") if err != nil { panic(err) } defer func() { _ = f.Close() }() if _, err := io.Copy(os.Stdout, f); err != nil { panic(err) } }
Running
pkger
1.17.1 will error when running on Go 1.18 code that uses type parameters/generics. An example can be found in this gist.An example of Go code that will cause the error.