Skip to content

Commit 122c7a5

Browse files
author
Daniele Marostica
committed
fixed lint
1 parent 9d51b2a commit 122c7a5

File tree

3 files changed

+36
-4
lines changed

3 files changed

+36
-4
lines changed

internal/cmd/project/describe.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package project
1717

1818
import (
1919
"context"
20+
"errors"
2021
"fmt"
2122
"io"
2223

@@ -33,6 +34,7 @@ const (
3334
describeProjectCmdLong = `Describe the configuration of the specified Project.`
3435

3536
ErrMultipleIdentifiers = "multiple identifiers specified, please provide only one"
37+
ErrMissingIdentifier = "missing revision/version/branch/tag name, please provide one as argument"
3638
)
3739

3840
type describeProjectOptions struct {
@@ -133,7 +135,7 @@ func GetRefFromOptions(options describeProjectOptions) (configuration.Ref, error
133135

134136
if len(options.VersionName) > 0 {
135137
if len(refType) > 0 {
136-
return configuration.Ref{}, fmt.Errorf(ErrMultipleIdentifiers)
138+
return configuration.Ref{}, errors.New(ErrMultipleIdentifiers)
137139
}
138140

139141
refType = configuration.VersionRefType
@@ -142,7 +144,7 @@ func GetRefFromOptions(options describeProjectOptions) (configuration.Ref, error
142144

143145
if len(options.BranchName) > 0 {
144146
if len(refType) > 0 {
145-
return configuration.Ref{}, fmt.Errorf(ErrMultipleIdentifiers)
147+
return configuration.Ref{}, errors.New(ErrMultipleIdentifiers)
146148
}
147149

148150
refType = configuration.BranchRefType
@@ -151,15 +153,15 @@ func GetRefFromOptions(options describeProjectOptions) (configuration.Ref, error
151153

152154
if len(options.TagName) > 0 {
153155
if len(refType) > 0 {
154-
return configuration.Ref{}, fmt.Errorf(ErrMultipleIdentifiers)
156+
return configuration.Ref{}, errors.New(ErrMultipleIdentifiers)
155157
}
156158

157159
refType = configuration.TagRefType
158160
refName = options.TagName
159161
}
160162

161163
if len(refType) == 0 {
162-
return configuration.Ref{}, fmt.Errorf("missing revision/version/branch/tag name, please provide one as argument")
164+
return configuration.Ref{}, errors.New(ErrMissingIdentifier)
163165
}
164166

165167
return configuration.NewRef(refType, refName)

internal/resources/configuration/ref.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// Copyright Mia srl
2+
// SPDX-License-Identifier: Apache-2.0
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
116
package configuration
217

318
import (

internal/resources/configuration/ref_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// Copyright Mia srl
2+
// SPDX-License-Identifier: Apache-2.0
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
116
package configuration
217

318
import (

0 commit comments

Comments
 (0)