paulsmith/gogeos

Beego Geometry Model Throwing Error (panic: reflect: call of reflect.Value.Interface on zero Value)

vishnuchilamakuru opened this issue · 0 comments

My Beego Model,

package models

import (
"github.com/astaxie/beego/orm"
_ "github.com/lib/pq"
// "time"
"github.com/paulsmith/gogeos/geos"
)

type Configuration struct {

Id int64 db:"id"
Created int64 db:"created_at";auto_now_add
Updated int64 db:"updated_at";auto_now
Tenant string db:"tenant",size=100
Role string db:"role",size=250
ServiceCode string db:"service_code",size=100
Url string db:url,size=512
Active bool db:is_active
Location string db:location
LocationGeom *geos.Geometry db:location_geom:default(geos.EmptyPolygon())
}

func init() {
// Need to register model in init
orm.RegisterModel( new(Configuration) )
}

I am getting the following Error on starting the application

panic: reflect: call of reflect.Value.Interface on zero Value

goroutine 1 [running]:
reflect.valueInterface(0x0, 0x0, 0x0, 0x1, 0x0, 0x0)
/usr/local/go/src/reflect/value.go:877 +0x90
reflect.Value.Interface(0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/reflect/value.go:872 +0x53
github.com/astaxie/beego/orm.getFieldType(0x45d4660, 0xc2080be070, 0xd6, 0x0, 0x0, 0x0)