Help us shape the future of Go! Take the 2026 Go Developer Survey

diff

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package diff implements the pr diff command

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdDiff

func NewCmdDiff(f *cmdutil.Factory, runF func(*DiffOptions) error) *cobra.Command

NewCmdDiff creates the diff command

Types

type DiffFile added in v0.5.0

type DiffFile struct {
	Path    string `json:"path"`
	OldPath string `json:"old_path,omitempty"`
	Added   int    `json:"added"`
	Removed int    `json:"removed"`
	NewFile bool   `json:"new_file,omitempty"`
	Deleted bool   `json:"deleted,omitempty"`
	Renamed bool   `json:"renamed,omitempty"`
}

DiffFile represents a file in the diff

type DiffOptions

type DiffOptions struct {
	IO         *iostreams.IOStreams
	HttpClient func() (*http.Client, error)
	BaseRepo   func() (string, error)

	// Arguments
	Repository string
	Number     int

	// Flags
	JSON bool
}

type DiffResult added in v0.5.0

type DiffResult struct {
	Number       int        `json:"number"`
	Title        string     `json:"title"`
	HeadBranch   string     `json:"head_branch"`
	BaseBranch   string     `json:"base_branch"`
	AddedLines   int        `json:"added_lines"`
	RemovedLines int        `json:"removed_lines"`
	FileCount    int        `json:"file_count"`
	Files        []DiffFile `json:"files"`
}

DiffResult represents the JSON output for pr diff

Source Files

  • diff.go

Jump to

Keyboard shortcuts

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