github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/loader/errors.go (about) 1 package loader 2 3 import "go/scanner" 4 5 // Errors contains a list of parser errors or a list of typechecker errors for 6 // the given package. 7 type Errors struct { 8 Pkg *Package 9 Errs []error 10 } 11 12 func (e Errors) Error() string { 13 return "could not compile: " + e.Errs[0].Error() 14 } 15 16 // Error is a regular error but with an added import stack. This is especially 17 // useful for debugging import cycle errors. 18 type Error struct { 19 ImportStack []string 20 Err scanner.Error 21 } 22 23 func (e Error) Error() string { 24 return e.Err.Error() 25 } 26 27 // Error returned when loading a *Program for a test binary but no test files 28 // are present. 29 type NoTestFilesError struct { 30 ImportPath string 31 } 32 33 func (e NoTestFilesError) Error() string { 34 return "no test files" 35 }