
Replace most errors returned by the compiler (using errors.New) with an error type that includes the source location.
14 строки
203 Б
Go
14 строки
203 Б
Go
package compiler
|
|
|
|
import (
|
|
"go/token"
|
|
"go/types"
|
|
)
|
|
|
|
func (c *Compiler) makeError(pos token.Pos, msg string) types.Error {
|
|
return types.Error{
|
|
Fset: c.ir.Program.Fset,
|
|
Pos: pos,
|
|
Msg: msg,
|
|
}
|
|
}
|