Skip to content

Declare an Automation target.

An exact source excerpt. Inspect the complete file to see its imports, surrounding types, and error handling.

guest/go-module/product/automation.goExcerpt begins at line 35File SHA-256da971374d812a3d677914e2b5694c4634ccba36399f039fd034646bdcd11d3a5
Declare an Automation target go
// ActionTarget selects one governed operation. A targeted Action declares its// subject with the same literal/occurrence source type as every other argument.func ActionTarget(name string, subject ...Argument) AutomationTarget {	target := AutomationTarget{Kind: TargetAction, Name: name}	if len(subject) > 1 {		panic("ActionTarget accepts at most one subject")	}	if len(subject) == 1 {		copy := cloneArgument(subject[0])		target.Subject = &copy	}	return target}func WorkflowTarget(name string) AutomationTarget {	return AutomationTarget{Kind: TargetWorkflow, Name: name}}func AgentTarget(name string) AutomationTarget {	return AutomationTarget{Kind: TargetAgent, Name: name}
Run it in its product environment.

This source depends on its surrounding product, generated libraries, and platform runtime. The website demonstrations run locally in your browser and do not execute this source against a workspace.