Show HN: Nosigsegv – Say goodbye to crashes in your Go apps

41
Show HN: Nosigsegv – Say goodbye to crashes in your Go apps

Remove nil pointer problems from your go program!

Usage

If you are running a recent Linux version, you need to run the following command before using nosigsegv.

sudo sysctl -w vm.mmap_min_addr=0

Now nil pointers are not going to crash your program anymore.

Example

Add the following line at the top of your go program:

import _ "github.com/thebabush/nosigsegv"

For a complete example, see cmd/nosigsegv/main.go.

Test it yourself:

Limitations
  • Only works on Linux
  • Does not support pointer values other than nil, unless there’s already something allocated at that address

Join the pack! Join 8000+ others registered users, and get chat, make groups, post updates and make friends around the world!
www.knowasiak.com/register/
Read More

Charlie Layers
WRITTEN BY

Charlie Layers

Fill your life with experiences so you always have a great story to tell