https://github.com/atomicgo/ghissue
📦 Go library that enables your users to submit error reports to GitHub
https://github.com/atomicgo/ghissue
atomicgo feedback github go golang golang-library issues
Last synced: 9 months ago
JSON representation
📦 Go library that enables your users to submit error reports to GitHub
- Host: GitHub
- URL: https://github.com/atomicgo/ghissue
- Owner: atomicgo
- License: mit
- Created: 2022-06-28T12:08:22.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-08T17:04:19.000Z (over 1 year ago)
- Last Synced: 2025-03-14T15:05:23.701Z (11 months ago)
- Topics: atomicgo, feedback, github, go, golang, golang-library, issues
- Language: Go
- Homepage: https://atomicgo.dev
- Size: 4.58 MB
- Stars: 13
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
AtomicGo | ghissue

---
Documentation
|
Contributing
|
Code of Conduct
---
go get atomicgo.dev/ghissue
# ghissue
```go
import "atomicgo.dev/ghissue"
```
Package ghissue enables your users to submit issues to GitHub directly.
\!\[Demo Video\]\(https://raw.githubusercontent.com/atomicgo/ghissue/main/demo.gif\)
Example:
```
repo := ghissue.NewRepository("atomicgo", "ghissue")
// [...]
err := errors.New("This is an error")
repo.CreateErrorReport(err) // Only creates an error report if the error is not nil
```
## Index
- [Variables](<#variables>)
- [type Issue](<#Issue>)
- [func NewIssue\(repo Repository, title, body string\) Issue](<#NewIssue>)
- [func \(issue Issue\) GetCreateURL\(\) string](<#Issue.GetCreateURL>)
- [func \(issue Issue\) Open\(\) error](<#Issue.Open>)
- [type Repository](<#Repository>)
- [func NewRepository\(owner, name string\) Repository](<#NewRepository>)
- [func \(repo Repository\) CreateErrorReport\(err error\) error](<#Repository.CreateErrorReport>)
- [func \(repo Repository\) NewIssue\(title, body string\) Issue](<#Repository.NewIssue>)
- [func \(repo Repository\) String\(\) string](<#Repository.String>)
## Variables
ErrOpenBrowser is the error returned when opening the browser fails.
```go
var ErrOpenBrowser = errors.New("failed to open browser")
```
Issue is a GitHub issue.
```go
type Issue struct {
Repository Repository
Title string
Body string
}
```
```go
func NewIssue(repo Repository, title, body string) Issue
```
NewIssue creates a new issue.
### func \(Issue\) [GetCreateURL]()
```go
func (issue Issue) GetCreateURL() string
```
GetCreateURL returns the URL to create an issue.
```go
func (issue Issue) Open() error
```
Open opens the "create issue" menu on GitHub in the browser.
Repository is a GitHub repository.
```go
type Repository struct {
Owner string
Name string
}
```
```go
func NewRepository(owner, name string) Repository
```
NewRepository creates a new Repository from an owner and repository name.
### func \(Repository\) [CreateErrorReport]()
```go
func (repo Repository) CreateErrorReport(err error) error
```
CreateErrorReport creates a new issue on GitHub with a detailed error report including the stack trace.
Example:
```
repo := ghissue.NewRepository("atomicgo", "ghissue")
// [...]
err := errors.New("This is an error")
repo.CreateErrorReport(err)
```
### func \(Repository\) [NewIssue]()
```go
func (repo Repository) NewIssue(title, body string) Issue
```
NewIssue creates a new issue with a title and body.
### func \(Repository\) [String]()
```go
func (repo Repository) String() string
```
String returns the string representation of the repository.
Generated by [gomarkdoc]()
---
> [AtomicGo.dev](https://atomicgo.dev) ·
> with ❤️ by [@MarvinJWendt](https://github.com/MarvinJWendt) |
> [MarvinJWendt.com](https://marvinjwendt.com)