pjvds / tidy

Go lang structured logging made fast and simple
7 stars 0 forks source link

GetModuleFromCaller can return wrong module name #10

Closed pjvds closed 9 years ago

pjvds commented 9 years ago

When retrieving a module via the caller context from a attached method, it seems to get the module name wrong.

type foo struct{}

func (this foo) GetModule() tidy.Module {
    return tidy.GetModuleFromCaller(0)
}

func main() {
      print(foo{}.GetModule().String())
}

The code above outputs:

my_package.foo 

And I expect:

my_package