gorepo

package module
v0.0.0-...-92e3477 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 19 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Go Reference Code Coverage License

Go Reference Code Coverage License

Additional Information

Contributing

Contributions are welcome — please open an issue or a pull request on GitHub.

License

This project is licensed under the Apache 2.0 License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct{ *ghrepo.Repository }

Repository represents a local go repository.

func (Repository) Dependencies

func (r Repository) Dependencies() ([]*modfile.Require, error)

Dependencies returns the list of required modules declared in go.mod.

func (Repository) GoFix

func (r Repository) GoFix(ctx context.Context) error

func (Repository) GoGenerate

func (r Repository) GoGenerate(ctx context.Context) error

func (Repository) GoGetAll

func (r Repository) GoGetAll(ctx context.Context) error

GoGetAll updates all package dependencies reachable from the module, its tests' included.

func (Repository) GoGetTools

func (r Repository) GoGetTools(ctx context.Context) error

GoGetTools updates all tool dependencies listed in go.mod.

func (Repository) GoModInit

func (r Repository) GoModInit(ctx context.Context) error

GoModInit initializes a go module in the repository.

func (Repository) GoModTidy

func (r Repository) GoModTidy(ctx context.Context) error

GoModTidy tidies the go module in the repository.

func (Repository) GoModVendor

func (r Repository) GoModVendor(ctx context.Context) error

GoModVendor vendors all dependencies in the repository.

func (*Repository) GoTestCover

func (r *Repository) GoTestCover(ctx context.Context) (float64, error)

func (Repository) GoVet

func (r Repository) GoVet(ctx context.Context) error

GoVet runs go vet on the repository

func (Repository) Gofumpt

func (r Repository) Gofumpt(ctx context.Context) error

func (Repository) Goimports

func (r Repository) Goimports(ctx context.Context) error

func (Repository) GolangCILint

func (r Repository) GolangCILint(ctx context.Context) error

func (Repository) GolangCILintFix

func (r Repository) GolangCILintFix(ctx context.Context) error

func (Repository) GolangCILintWithLinters

func (r Repository) GolangCILintWithLinters(ctx context.Context, fix bool, settings config.Linters) error

GolangCILintWithLinters runs golangci-lint with these linters only; a setting left at its zero value keeps golangci-lint's default, so a default of true cannot be turned off.

func (Repository) IsGoRepo

func (r Repository) IsGoRepo() (bool, error)

func (Repository) SettleModules

func (r Repository) SettleModules(ctx context.Context) error

SettleModules brings go.mod and go.sum in line with the code, and vendor/ where the module vendors: after a change that imports a package go.mod does not require or vendor/ does not hold yet, for one.

func (Repository) UpdateDependencies

func (r Repository) UpdateDependencies(ctx context.Context) error

UpdateDependencies updates all dependencies in the repository.

func (Repository) UpdateTools

func (r Repository) UpdateTools(ctx context.Context) error

UpdateTools updates all go tools in the repository.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is a repository service for gorepo repositories.

func NewService

func NewService(ctx context.Context, githubToken string, opts ...ghrepo.Option) *Service

NewService creates a new gorepo Service.

func (*Service) NewRepository

func (s *Service) NewRepository(ctx context.Context, owner, name string, opts ...ghrepo.Option) (*Repository, error)

NewRepository opens or initializes a repository at the given path.

func (*Service) PrefetchOrgRepositories

func (s *Service) PrefetchOrgRepositories(ctx context.Context, org string) error

PrefetchOrgRepositories fetches all repositories by the given organization and caches them. This is useful to avoid hitting the GitHub API rate limits when creating multiple repositories.

func (*Service) PrefetchUserRepositories

func (s *Service) PrefetchUserRepositories(ctx context.Context, user string) error

PrefetchUserRepositories fetches all repositories by the given user and caches them. This is useful to avoid hitting the GitHub API rate limits when creating multiple repositories.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址