1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-11-06 09:09:19 +02:00

fix: remove unused variables from generated step coding (#1698)

* remove unused parameters from generated code

* update steps

* update steps

* correct golden files

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
This commit is contained in:
Christopher Fenner
2020-06-23 18:05:21 +02:00
committed by GitHub
parent f348c53989
commit c42553593e
32 changed files with 63 additions and 65 deletions

View File

@@ -42,7 +42,7 @@ Please provide either of the following options:
* The host and credentials the Cloud Platform ABAP Environment system itself. The credentials must be configured for the Communication Scenario SAP_COM_0510.
* The Cloud Foundry parameters (API endpoint, organization, space), credentials, the service instance for the ABAP service and the service key for the Communication Scenario SAP_COM_0510.
* Only provide one of those options with the respective credentials. If all values are provided, the direct communication (via host) has priority.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -65,7 +65,7 @@ Please provide either of the following options:
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -44,7 +44,7 @@ Please provide either of the following options:
* Only provide one of those options with the respective credentials. If all values are provided, the direct communication (via host) has priority.
Regardless of the option you chose, please make sure to provide the configuration for Software Components and Packages that you want to be checked analog to the examples listed on this page.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -65,7 +65,7 @@ Regardless of the option you chose, please make sure to provide the configuratio
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -145,7 +145,7 @@ Define ` + "`" + `buildTool: custom` + "`" + `, ` + "`" + `filePath: <path to yo
#### ` + "`" + `yaml` + "`" + ` file containing the version
Define ` + "`" + `buildTool: custom` + "`" + `, ` + "`" + `filePath: <path to your *.yml/*.yaml file` + "`" + ` as well as parameter ` + "`" + `versionSource` + "`" + ` to point to the parameter containing the version.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -168,7 +168,7 @@ Define ` + "`" + `buildTool: custom` + "`" + `, ` + "`" + `filePath: <path to yo
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -180,7 +180,7 @@ This step by default enforces a specific audit baseline for findings and therefo
You can adapt above thresholds specifically using the provided configuration parameters and i.e. check for ` + "`" + `absolute` + "`" + `
thresholds instead of ` + "`" + `percentage` + "`" + ` whereas we strongly recommend you to stay with the defaults provided.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -203,7 +203,7 @@ thresholds instead of ` + "`" + `percentage` + "`" + ` whereas we strongly recom
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -36,7 +36,7 @@ func CloudFoundryCreateServiceKeyCommand() *cobra.Command {
Use: STEP_NAME,
Short: "cloudFoundryCreateServiceKey",
Long: `Create CloudFoundryServiceKey`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -59,7 +59,7 @@ func CloudFoundryCreateServiceKeyCommand() *cobra.Command {
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -35,7 +35,7 @@ func CloudFoundryDeleteServiceCommand() *cobra.Command {
Use: STEP_NAME,
Short: "DeleteCloudFoundryService",
Long: `Delete CloudFoundryService`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -58,7 +58,7 @@ func CloudFoundryDeleteServiceCommand() *cobra.Command {
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -34,7 +34,7 @@ func ContainerSaveImageCommand() *cobra.Command {
Long: `This step allows you to save a container image, for example a Docker image into a tar file.
It can be used no matter if a Docker daemon is available or not. It will also work inside a Kubernetes cluster without access to a daemon.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -55,7 +55,7 @@ It can be used no matter if a Docker daemon is available or not. It will also wo
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -36,7 +36,7 @@ func DetectExecuteScanCommand() *cobra.Command {
Use: STEP_NAME,
Short: "Executes Synopsis Detect scan",
Long: `This step executes [Synopsis Detect](https://synopsys.atlassian.net/wiki/spaces/INTDOCS/pages/62423113/Synopsys+Detect) scans.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -58,7 +58,7 @@ func DetectExecuteScanCommand() *cobra.Command {
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -141,7 +141,7 @@ The Fortify step triggers a scan locally on your Jenkins within a docker contain
and Java plus Maven or alternatively Python installed into it for being able to perform any scans.
DISCLAIMER: The step has not yet been tested on a wide variaty of projects, and is therefore considered of BETA quality.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -164,7 +164,7 @@ DISCLAIMER: The step has not yet been tested on a wide variaty of projects, and
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -33,7 +33,7 @@ func GctsCloneRepositoryCommand() *cobra.Command {
Use: STEP_NAME,
Short: "Clones a Git repository",
Long: `Clones a Git repository from a remote repository to a local repository on an ABAP system. To be able to execute this step, the corresponding local repository has to exist on the local ABAP system.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -56,7 +56,7 @@ func GctsCloneRepositoryCommand() *cobra.Command {
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -37,7 +37,7 @@ func GctsCreateRepositoryCommand() *cobra.Command {
Use: STEP_NAME,
Short: "Creates a Git repository on an ABAP system",
Long: `Creates a local Git repository on an ABAP system if it does not already exist.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -60,7 +60,7 @@ func GctsCreateRepositoryCommand() *cobra.Command {
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -34,7 +34,7 @@ func GctsDeployCommand() *cobra.Command {
Use: STEP_NAME,
Short: "Pulls a commit from the remote Git repository to a local repository",
Long: `Pulls a commit from the corresponding remote Git repository to a specified local repository on an ABAP system. If no <commit> parameter is specified, this step will pull the latest commit available on the remote repository.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -57,7 +57,7 @@ func GctsDeployCommand() *cobra.Command {
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -41,7 +41,7 @@ func GithubCreatePullRequestCommand() *cobra.Command {
Long: `This step allows you to create a pull request on Github.
It can for example be used for GitOps scenarios or for scenarios where you want to have a manual confirmation step which is delegated to a GitHub pull request.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -63,7 +63,7 @@ It can for example be used for GitOps scenarios or for scenarios where you want
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -52,7 +52,7 @@ The release can be filled with text plus additional information like:
The result looks like
![Example release](../images/githubRelease.png)`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -74,7 +74,7 @@ The result looks like
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -32,7 +32,7 @@ func JsonApplyPatchCommand() *cobra.Command {
Short: "Patches a json with a patch file",
Long: `This steps patches a json file with patch file using the json patch standard.
This step can, e.g., be used if there is a json schema which needs to be patched.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -53,7 +53,7 @@ This step can, e.g., be used if there is a json schema which needs to be patched
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -41,7 +41,7 @@ In the Docker network, the containers can be referenced by the values provided i
!!! note
In a Kubernetes environment, the containers both need to be referenced with ` + "`" + `localhost` + "`" + `.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -62,7 +62,7 @@ In the Docker network, the containers can be referenced by the values provided i
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -64,7 +64,7 @@ helm upgrade <deploymentName> <chartPath> --install --force --namespace <namespa
* ` + "`" + `yourRegistry` + "`" + ` will be retrieved from ` + "`" + `containerRegistryUrl` + "`" + `
* ` + "`" + `yourImageName` + "`" + `, ` + "`" + `yourImageTag` + "`" + ` will be retrieved from ` + "`" + `image` + "`" + `
* ` + "`" + `dockerSecret` + "`" + ` will be calculated with a call to ` + "`" + `kubectl create secret docker-registry regsecret --docker-server=<yourRegistry> --docker-username=<containerRegistryUser> --docker-password=<containerRegistryPassword> --dry-run=true --output=json'` + "`" + ``,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -89,7 +89,7 @@ helm upgrade <deploymentName> <chartPath> --install --force --namespace <namespa
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -33,7 +33,7 @@ func MalwareExecuteScanCommand() *cobra.Command {
Use: STEP_NAME,
Short: "Performs a malware scan",
Long: `Performs a malware scan`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -56,7 +56,7 @@ func MalwareExecuteScanCommand() *cobra.Command {
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -37,7 +37,7 @@ func MavenBuildCommand() *cobra.Command {
Long: `This step will install the maven project into the local maven repository.
It will also prepare jacoco to record the code coverage and
supports ci friendly versioning by flattening the pom before installing.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -58,7 +58,7 @@ supports ci friendly versioning by flattening the pom before installing.`,
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -47,7 +47,7 @@ For more information please visit https://pmd.github.io/.
The plugins should be configured in the respective pom.xml.
For SpotBugs include- and exclude filters as well as maximum allowed violations are conifgurable via .pipeline/config.yml.
For PMD the failure priority and the max allowed violations are configurable via .pipeline/config.yml.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -68,7 +68,7 @@ For PMD the failure priority and the max allowed violations are configurable via
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -37,7 +37,7 @@ func MavenExecuteCommand() *cobra.Command {
Use: STEP_NAME,
Short: "This step allows to run maven commands",
Long: `This step runs a maven command based on the parameters provided to the step.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -58,7 +58,7 @@ func MavenExecuteCommand() *cobra.Command {
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -70,7 +70,7 @@ func MtaBuildCommand() *cobra.Command {
Use: STEP_NAME,
Short: "Performs an mta build",
Long: `Executes the SAP Multitarget Application Archive Builder to create an mtar archive of the application.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -91,7 +91,7 @@ func MtaBuildCommand() *cobra.Command {
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -55,7 +55,7 @@ It will use your gitignore file to exclude the mached files from publishing.
Note: npm's gitignore parser might yield different results from your git client, to ignore a "foo" directory globally use the glob pattern "**/foo".
If an image for mavenExecute is configured, and npm packages are to be published, the image must have npm installed.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -78,7 +78,7 @@ If an image for mavenExecute is configured, and npm packages are to be published
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -32,7 +32,7 @@ func NpmExecuteLintCommand() *cobra.Command {
Short: "Execute ci-lint script on all npm packages in a project or execute default linting",
Long: `Execute ci-lint script for all package json files, if they implement the script. If no ci-lint script is defined,
either use ESLint configurations present in the project or use the provided general purpose configuration to run ESLint.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -53,7 +53,7 @@ either use ESLint configurations present in the project or use the provided gene
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -33,7 +33,7 @@ func NpmExecuteScriptsCommand() *cobra.Command {
Use: STEP_NAME,
Short: "Execute npm run scripts on all npm packages in a project",
Long: `Execute npm run scripts in all package json files, if they implement the scripts.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -54,7 +54,7 @@ func NpmExecuteScriptsCommand() *cobra.Command {
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -95,7 +95,7 @@ func ProtecodeExecuteScanCommand() *cobra.Command {
!!! hint "Auditing findings (Triaging)"
Triaging is now supported by the Protecode backend and also Piper does consider this information during the analysis of the scan results though product versions are not supported by Protecode. Therefore please make sure that the ` + "`" + `fileName` + "`" + ` you are providing does either contain a stable version or that it does not contain one at all. By ensuring that you are able to triage CVEs globally on the upload file's name without affecting any other artifacts scanned in the same Protecode group and as such triaged vulnerabilities will be considered during the next scan and will not fail the build anymore.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -118,7 +118,7 @@ func ProtecodeExecuteScanCommand() *cobra.Command {
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -83,7 +83,7 @@ func SonarExecuteScanCommand() *cobra.Command {
Use: STEP_NAME,
Short: "Executes the Sonar scanner",
Long: `The step executes the [sonar-scanner](https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner) cli command to scan the defined sources and publish the results to a SonarQube instance.`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -106,7 +106,7 @@ func SonarExecuteScanCommand() *cobra.Command {
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -70,7 +70,7 @@ func XsDeployCommand() *cobra.Command {
Use: STEP_NAME,
Short: "Performs xs deployment",
Long: `Performs xs deployment`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -93,7 +93,7 @@ func XsDeployCommand() *cobra.Command {
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -86,7 +86,7 @@ func {{.CobraCmdFuncName}}() *cobra.Command {
Use: STEP_NAME,
Short: "{{.Short}}",
Long: {{ $tick := "` + "`" + `" }}{{ $tick }}{{.Long | longName }}{{ $tick }},
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose({{if .ExportPrefix}}{{ .ExportPrefix }}.{{end}}GeneralConfig.Verbose)
@@ -109,7 +109,7 @@ func {{.CobraCmdFuncName}}() *cobra.Command {
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -22,7 +22,7 @@ type PiperEnvironmentParameter struct {
}
const piperEnvStructTemplate = `type {{ .StepName }}{{ .Name | title}} struct {
{{ range $notused, $param := .Parameters }}
{{- range $notused, $param := .Parameters }}
{{- if not $param.Category}}
{{ $param.Name | golangName }} string
{{- end }}

View File

@@ -24,7 +24,6 @@ type testStepOptions struct {
type testStepCommonPipelineEnvironment struct {
artifactVersion string
git struct {
commitID string
@@ -106,7 +105,7 @@ func TestStepCommand() *cobra.Command {
Use: STEP_NAME,
Short: "Test description",
Long: `Long Test description`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(piperOsCmd.GeneralConfig.Verbose)
@@ -127,7 +126,7 @@ func TestStepCommand() *cobra.Command {
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {

View File

@@ -23,7 +23,6 @@ type testStepOptions struct {
type testStepCommonPipelineEnvironment struct {
artifactVersion string
git struct {
commitID string
@@ -105,7 +104,7 @@ func TestStepCommand() *cobra.Command {
Use: STEP_NAME,
Short: "Test description",
Long: `Long Test description`,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(cmd *cobra.Command, _ []string) error {
startTime = time.Now()
log.SetStepName(STEP_NAME)
log.SetVerbose(GeneralConfig.Verbose)
@@ -126,7 +125,7 @@ func TestStepCommand() *cobra.Command {
return nil
},
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
telemetryData := telemetry.CustomData{}
telemetryData.ErrorCode = "1"
handler := func() {