skynetservices / skynet-archive

Skynet is a framework for distributed services in Go.
1.97k stars 323 forks source link

about wiki "Create a simple service" #208

Open zweite opened 10 years ago

zweite commented 10 years ago

skynet service hadn't GetServiceConfig function, it change to NewServiceInfo.

func main() {
    tutorial := &TutorialService{}
    config := skynet.NewServiceInfo("TutorialService", "1")
    config.Region = "Development"
    service := service.CreateService(tutorial, config)
    defer func() {
        service.Shutdown()
    }()
    waiter := service.Start()
    waiter.Wait()
}

However, I found the exception , panic: runtime error: invalid memory address or nil pointer dereference [signal 0xb code=0x1 addr=0x0 pc=0x4f0a9e]

miekg commented 10 years ago

This is with skydns version 1 probably? Note that main development is now focussed on skydns2 where things are done different. On 25 Jul 2014 03:26, "zweite" notifications@github.com wrote:

skynet service hadn't GetServiceConfig function, it change to NewServiceInfo. func main() { tutorial := &TutorialService{} config := skynet.NewServiceInfo("TutorialService", "1") config.Region = "Development"

service := service.CreateService(tutorial, config)

defer func() { service.Shutdown() }()

waiter := service.Start() waiter.Wait()

}

However, I found the exception , panic: runtime error: invalid memory address or nil pointer dereference [signal 0xb code=0x1 addr=0x0 pc=0x4f0a9e]

— Reply to this email directly or view it on GitHub https://github.com/skynetservices/skynet/issues/208.

zweite commented 10 years ago

thank you