I'm having a problem with my project.
getting the error:
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x44c16f]
What am I doing wrong?
package A
package a
import (
"fmt"
"github.com/lathrel/test/b"
)
type (
// App ...
App b.App
)
// Fine is a fine :) but was fine :/
func (app *App) Fine(str string) string {
fmt.Println(str)
return ""
}
package B
package b
// App is a test
type App struct {
fine Controller
}
// Controller is a test
type Controller interface {
Fine(str string) string
}
// InitB inits B :)
func InitB() {
app := App{}
app.fine.Fine("hi")
}
main.go
package main
import (
"github.com/lathrel/test/b"
)
func main() {
b.InitB()
}