package utils

func CheckError(e error) {
    if e != nil {
        panic(e)
    }
}

package utils

import (
  "fmt"
  "strconv"
  "strings"
)

func CheckError(e error) {
    if e != nil {
        panic(e)
    }
}

func ReportError(line int, column int, where string, message string) {
  fmt.Printf("Error: %v\n", message)
  fmt.Printf("  %v | %v\n", line, where)
  fmt.Printf("%v^--\n", strings.Repeat(" ", 5 + column + len(strconv.Itoa(line))))
}

Add custom style to error reporting function
Add custom style to error reporting function

* Along with the line number, it shows the column also.
  With a indicator pointing to the error-prone source code.
