code: func sprintError(err error) string {
  	makeRel := func(name string) string {
  		if relname, err := filepath.Rel(currentDirectory, name); err == nil {
  			return relname
  		}
  		return name
  	}
  
  	switch e := err.(type) {
  	case *scanner.Error:
  		return fmt.Sprintf("%s:%d:%d: %s", makeRel(e.Pos.Filename), e.Pos.Line, e.Pos.Column, e.Msg)
  	case types.Error:
  		pos := e.Fset.Position(e.Pos)
  		return fmt.Sprintf("%s:%d:%d: %s", makeRel(pos.Filename), pos.Line, pos.Column, e.Msg)
  	default:
  		return fmt.Sprintf("%s", e)
  	}
  }
docs: // sprintError returns an annotated error string without trailing newline.