You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: workflow_stop.go
    path of file: ./repos/cds/cli/cdsctl
    
    the code of the file until where you have to start completion: package main

import (
	"fmt"

	"github.com/ovh/cds/cli"
)

var workflowStopCmd = cli.Command{
	Name:  "stop",
	Short: "Stop a CDS workflow or a specific node name",
	Long:  "Stop a CDS workflow or a specific node name",
	Example: `cdsctl workflow stop # Stop the workflow run for the current repo and the current hash
cdsctl workflow stop 
    
func workflowStopRun(v cli.Values) error {
	// If no run number, get the latest
	runNumber, errRunNumber := v.GetInt64("run-number")
	if runNumber == 0 {
		runNumber, errRunNumber = workflowNodeForCurrentRepo(v.GetString(_ProjectKey), v.GetString(_WorkflowName))
	}
	if errRunNumber != nil {
		return errRunNumber
	}

	var fromNodeID int64
	if v.GetString("node-name") != "" {
		if runNumber <= 0 {
			return cli.NewError("You can use flag node-name without flag run-number")
		}
		wr, err := client.WorkflowRunGet(v.GetString(_ProjectKey), v.GetString(_WorkflowName), runNumber)
		if err != nil {
			return err
		}
		for _, wnrs := range wr.WorkflowNodeRuns {
			if wnrs[0].WorkflowNodeName == v.GetString("node-name") {
				fromNodeID = wnrs[0].ID
				break
			}
		}
		if fromNodeID == 0 {
			return cli.NewError("Node not found")
		}
	}

	if fromNodeID != 0 {
		wNodeRun, err := client.WorkflowNodeStop(v.GetString(_ProjectKey), v.GetString(_WorkflowName), runNumber, fromNodeID)
		if err != nil {
			return err
		}
		fmt.Printf("Workflow node %s from workflow %s #%d has been stopped\n", v.GetString("node-name"), v.GetString(_WorkflowName), wNodeRun.Number)
	} else {
		w, err := client.WorkflowStop(v.GetString(_ProjectKey), v.GetString(_WorkflowName), runNumber)
		if err != nil {
			return err
		}
		fmt.Printf("Workflow %s #%d has been stopped\n", v.GetString(_WorkflowName), w.Number)
	}

	return nil
}