So, I'm trying to figure out packages in Go at the moment. It seemed all right until I started writing a package that needs a function from the main package. Anyone can point this out to me? Currently, I have handlers.go in the Handlers package. It needs the checkError() function from util.go, which is in the Main package. I figured functions in the main package would automatically be available in other packages, but when I try to build it I get the following error:

handlers\handlers.go:8: undefined checkError
handlers.go
Code:
package handlers

import "io/ioutil"


func openTemplate(file string) string {
    content, err := ioutil.ReadFile(file)
    checkError(err)

    result := string(content)
    return result
}
util.go
Code:
package main 

import "log"

func checkError(err error) {
    if err != nil {
        logError(err.Error())
        log.Fatal(err)
    }
}