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

share

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package share implements the share command, which renders the current stack as Slack-flavored markdown for copy-pasting.

Index

Constants

View Source
const DefaultMarker = "👈"

DefaultMarker is appended to the current branch's line in shared output.

Variables

This section is empty.

Functions

func Action

func Action(ctx context.Context, deps Deps, opts Options) error

Action renders the current stack as Slack-flavored markdown (mrkdwn) suitable for copy-pasting into a Slack message. Each branch is emitted as a bullet: branches with an open PR become a clickable link (#<number> <title>), while branches without a PR fall back to their branch name so the stack is still complete before submit. Branches are listed base-first, mirroring the stack navigation footer that Stackit writes into PR bodies.

Types

type Deps

type Deps struct {
	Engine Engine
	Out    output.Output
}

Deps are the collaborators share needs.

type Engine

type Engine interface {
	CurrentBranch(ctx context.Context) *engine.Branch
	GetBranch(branchName string) engine.Branch
	Graph(ctx context.Context, strategy engine.SortStrategy) *engine.StackGraph
	BranchesDepthFirst(startBranch engine.Branch) iter.Seq2[engine.Branch, int]
}

Engine lists exactly the engine methods share calls.

type Options

type Options struct {
	// BranchName selects the stack to share. Defaults to the current branch.
	BranchName string
	// Marker indicates the current branch in the output. Defaults to
	// DefaultMarker.
	Marker string
}

Options configures how the stack is rendered for sharing.

Jump to

Keyboard shortcuts

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