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

scriptbehavior

package
v1.149.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package scriptbehavior says what a new version of a managed script does differently from the saved one (#1942): where their outputs differ when both replay the same recorded run, and what the new version reaches that the saved one did not.

A save with no difference and no new reach is a refactor and goes through. Any other save needs a plain-language summary of the change and the agent's confirmation that the person the automation runs for agreed to it; the differences are what that person is told.

Index

Constants

View Source
const (
	KindOutput = "output"
	KindColumn = "column"
	KindRows   = "rows"
	KindState  = "state"
	KindNotify = "notification"
	KindResult = "result"
	KindCall   = "call"
	KindFails  = "failure"
	KindReach  = "reach"
)

The kinds of difference.

Variables

This section is empty.

Functions

This section is empty.

Types

type Difference

type Difference struct {
	// Run is the recorded run the difference showed in, empty for reach.
	Run  string `json:"run,omitempty"`
	Kind string `json:"kind"`
	// Subject is what differs: an output's name, a column, a tool.
	Subject string `json:"subject"`
	Detail  string `json:"detail"`
}

Difference is one thing the new version does differently.

func Compare

func Compare(run string, before, after scripttest.Outcome) (diffs []Difference, compared bool)

Compare lists where after, the new version's replay of a recorded run, differs from before, the saved version's. compared is false when the saved version itself does not replay the run -- it was recorded under an older version that made calls this one does not -- so the run says nothing about this change.

func Reach

func Reach(before, after scriptrun.Report) []Difference

Reach lists what after, the new version's validation, reaches that before, the saved version's, did not: tools, connections, destinations and host bindings.

func (Difference) String

func (d Difference) String() string

String is the difference as one sentence.

Jump to

Keyboard shortcuts

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