Skip to content

thebabush/nosigsegv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

nosigsegv

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:

$ cd ./cmd/nosigsegv
$ go build
$ ./nosigsegv
initialization ok!
testing...
* <nil>  =  123

Limitations

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

About

Package to remove nil pointer errors from your Go programs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages