Product How it works Features Security What is bugstack? SDKs JavaScript SDK Python SDK Go SDK Ruby SDK Docs Pricing Blog Book a Demo
Log In Get started
Go

bugstack for Go

The bugstack SDK captures panics and uncaught server errors in Gin, Echo, and Go stdlib and starts a fix: nil pointer dereference, index out of range, and concurrency panics. It is the crash-capture part of a product that maintains your whole repository.

What Go Errors bugstack Fixes

Install the SDK

Add bugstack to your Go module:

go get github.com/MasonBachmann7/Bugstack-Go

Then initialize it in your main function:

import "github.com/MasonBachmann7/Bugstack-Go/bugstack"

func main() {
    bugstack.Init(bugstack.Config{
        APIKey: os.Getenv("BUGSTACK_API_KEY"),
    })
    defer bugstack.Flush()

    // your application code
}

Example Fix

bugstack detects a nil pointer dereference panic and writes a small fix:

Before (broken)
func GetUserEmail(id int) string {
    user := findUserByID(id)
    return user.Email
}

// Runtime panic when user is nil:
// panic: runtime error: invalid
//   memory address or nil pointer
//   dereference
After (fixed by bugstack)
func GetUserEmail(id int) (string, error) {
    user := findUserByID(id)
    if user == nil {
        return "", fmt.Errorf(
            "user %d not found", id,
        )
    }
    return user.Email, nil
}

What else bugstack does for this repository

The SDK is one part. Once your repository is connected, bugstack also scans your Go modules for known vulnerabilities and outdated versions, scans for secrets, and acts on failed deploys if you host on Render. It scans and reports, and it can open pull requests for what it finds. Those pull requests are switched on per account. Every change arrives as a pull request, and you set how much happens without you.

Related Error Guides

Full installation guide with config reference →

Hand off the upkeep of your Go app

bugstack captures panics and uncaught server errors in production, finds the cause, writes the fix, and opens a pull request in minutes. Your CI runs on every change, and you decide how much happens without you.

Get started with your Go app

Connect GitHub. Add the SDK. That's the setup.