SDKs JavaScript SDK Python SDK Go SDK Ruby SDK How It Works Features Pricing FAQ Blog
Log In Start Free Trial

Go SDK

Capture production errors automatically in your Go applications. Fast, concurrent, and lightweight.

Installation

$ go get github.com/MasonBachmann7/Bugstack-Go

Quick Start

go
package main

import (
    "log"
    "net/http"
    "os"

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

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

    http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
        w.Write([]byte("Hello World"))
    })

    // bugstack automatically captures panics and errors
    log.Fatal(http.ListenAndServe(":8080", nil))
}

Source Code

View the full source code, report issues, and contribute on GitHub.

← Back to Documentation