INNER CODE UNIT · Go

func

minekube/gate · release_asset_verification_test.go:32

func (n *assetWorkflowNeeds) UnmarshalYAML(node *yaml.Node) error {
	switch node.Kind {
	case yaml.ScalarNode:
		*n = []string{node.Value}
		return nil
	case yaml.SequenceNode:
		var needs []string
		if err := node.Decode(&needs); err != nil {
			return err
		}
		*n = needs
		return nil
	default:
		return fmt.Errorf("needs must be a string or list, got YAML kind %d", node.Kind)
	}
}

func TestAssetWorkflowAcceptsScalarAndListNeeds(t *testing.T) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…