Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime error #27709

Closed
akshitababel opened this issue Sep 17, 2018 · 1 comment
Closed

Runtime error #27709

akshitababel opened this issue Sep 17, 2018 · 1 comment

Comments

@akshitababel
Copy link

akshitababel commented Sep 17, 2018

When I am running a program which is for a web response I am getting a run time error as follows:
http: panic serving 127.0.0.1:43802: runtime error: invalid memory address or nil pointer dereference
goroutine 6 [running]:
net/http.(*conn).serve.func1(0xc4200a4a00)
/usr/lib/go-1.10/src/net/http/server.go:1726 +0x11b
panic(0x9b5360, 0xd99230)
/usr/lib/go-1.10/src/runtime/panic.go:502 +0x24a
github.com/ipfs/go-ipfs-api.(*RequestBuilder).Send(0xc4201740a0, 0xb95c60, 0xc420022100, 0x0, 0x0, 0x0)
The code of main file is as follows:
func main() {

router := httprouter.New()
router.RedirectTrailingSlash = true
c := cors.New(cors.Options{
	AllowedOrigins:   []string{"*"},
	AllowedMethods:   []string{"GET", "POST", "OPTIONS", "Authorization"},
	AllowedHeaders:   []string{"*"},
	AllowCredentials: true,
})
router.GET("/create", StoreAndGetHash)
router.GET("/read/:hashvalue", GetFile)
router.GET("/appdata/:appID", ReadPeer)
router.GET("/update", UpdateAndGetHash)
router.GET("/createdir", GetDir)
router.GET("/newkey", GetNewKey)

log.Fatal(http.ListenAndServe(":3000", c.Handler(router)))

}

I am working on ubuntu

@agnivade
Copy link
Contributor

Hi @akshitababel ,

This appears to be a genuine error rather than a Go bug. We do not use the issue tracker for general discussions or questions like these. The Github bug tracker is only used for tracking bugs and proposals going through the Proposal Process.

For further questions, please have a look at Questions wiki page; it has a list of good places for asking questions. Or possibly raise this issue with go-ipfs-api.

Closing since this is not a bug.

@golang golang locked and limited conversation to collaborators Sep 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants