go-github
by
google

Description: Go library for accessing the GitHub v3 API

View on GitHub ↗

Summary Information

Updated 46 minutes ago
Added to GitGenius on February 18th, 2025
Created on May 24th, 2013
Open Issues & Pull Requests: 30 (+0)
Number of forks: 2,251
Total Stargazers: 11,272 (+0)
Total Subscribers: 204 (+0)

Issue Activity (beta)

Open issues: 22
New in 7 days: 3
Closed in 7 days: 0
Avg open age: 469 days
Stale 30+ days: 15
Stale 90+ days: 13

Recent activity

Opened in 7 days: 2
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • good first issue (121)
  • enhancement (119)
  • Breaking API Change (28)
  • bug (23)
  • challenging (9)
  • NeedsInvestigation (8)
  • question (6)
  • waiting for reply (6)

Most active issues this week

Repository Insights (GitGenius)

Median issue/PR response: 1.4 hours
Mean response time: 265.9 days
90th percentile: 965.2 days
Tracked items: 348

Most active contributors

Detailed Description

go-github is a Go client library developed by Google for accessing the GitHub REST API v3. The library provides a structured interface for Go developers to interact with GitHub's API endpoints, organizing functionality into logical service chunks that correspond to the GitHub API documentation structure. The library is maintained at version 88 and is available through the standard Go module system.

The repository serves as a comprehensive API client that enables developers to programmatically access GitHub's features including repositories, pull requests, issues, organizations, and other GitHub resources. Authentication is handled through multiple methods including OAuth tokens via the WithAuthToken option, custom HTTP transports, and support for GitHub Apps through third-party packages like ghinstallation and go-githubauth. The library also supports HTTP Basic Authentication through the BasicAuthTransport for specific API methods that require it.

A significant aspect of go-github's design is its handling of rate limiting, which reflects GitHub's enforcement of both primary and secondary rate limits. The library provides built-in mechanisms to detect rate limit errors through RateLimitError and AbuseRateLimitError types, and includes methods like SleepUntilPrimaryRateLimitResetWhenRateLimited to manage rate limit constraints. The library also supports integration with external rate-limiting middleware packages for more advanced use cases. Additionally, the library handles 202 Accepted status codes that indicate asynchronously processed requests through AcceptedError detection.

The library follows Go's version support policy, maintaining compatibility with the latest two major releases of Go. The go.mod file reflects the minimum required Go version, which must be greater than or equal to the go directive of all dependencies. This approach ensures that users have clarity on version compatibility while allowing the maintainers to leverage modern Go features.

go-github implements pagination support for resource collections through both page number-based pagination via ListOptions and cursor-based pagination via ListCursorOptions. Starting with Go v1.23, the library provides auto-generated iterator methods that allow developers to range over paginated results directly, with automatic handling of pagination logic. The library also supports conditional HTTP requests through integration with RFC 9111 compliant HTTP caches, helping developers minimize rate limit consumption.

The repository shows active maintenance and community engagement. GitGenius tracking data reveals a median issue and pull request response latency of 1.4 hours across 348 items, with a mean latency of 6381 hours indicating some older items in the backlog. The most active labels are good first issue with 64 occurrences, enhancement with 61, and Breaking API Change with 21, suggesting ongoing feature development and API evolution. The primary contributor gmlewis has generated 1119 events, with additional significant contributions from stevehipwell and Not-Dhananjay-Mishra. The repository shares contributors with major projects including microsoft/vscode, golang/go, and microsoft/typescript, indicating its importance in the broader Go ecosystem.

The library is designed for creating and updating resources using pointer values for non-repeated fields, with helper functions provided for common types like strings, booleans, and integers. This pattern allows developers to distinguish between unset fields and zero-values, a design choice familiar to developers experienced with protocol buffers. The repository includes an example directory with sample code snippets demonstrating various use cases and API interactions.

go-github
by
googlegoogle/go-github

Repository Details

Fetching additional details & charts...