Skip to content

Commit 18d6da7

Browse files
authored
Merge pull request #2 from garethjevans/lint
chore: lint
2 parents e50c15c + 31f2d08 commit 18d6da7

4 files changed

Lines changed: 14 additions & 1 deletion

File tree

pkg/cmd/get.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ To get the latest LTS for a particular release train:
2525
`
2626
)
2727

28+
// GetCmd struct to hold the get command.
2829
type GetCmd struct {
2930
Cmd *cobra.Command
3031
Args []string
@@ -35,6 +36,7 @@ type GetCmd struct {
3536
Password string
3637
}
3738

39+
// NewGetCmd creates a new get command.
3840
func NewGetCmd() *cobra.Command {
3941
c := &GetCmd{}
4042
cmd := &cobra.Command{
@@ -66,6 +68,7 @@ func NewGetCmd() *cobra.Command {
6668
return cmd
6769
}
6870

71+
// Run runs the command.
6972
func (c *GetCmd) Run() error {
7073
v, err := version.GetJenkinsVersion(c.URL, c.VersionIdentifier, c.Username, c.Password)
7174
if err != nil {

pkg/maven/types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
package maven
22

3+
// Metadata struct to store metadata.
34
type Metadata struct {
45
GroupID string `xml:"groupId"`
56
ArtifactID string `xml:"artifactId"`
67
Versioning Versioning `xml:"versioning"`
78
}
89

10+
// Versioning struct to store versioning.
911
type Versioning struct {
1012
Latest string `xml:"latest"`
1113
Release string `xml:"release"`
1214
Versions Versions `xml:"versions"`
1315
}
1416

17+
// Versions struct to store versions.
1518
type Versions struct {
1619
Versions []string `xml:"version"`
1720
}

pkg/version/jenkins.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@ import (
1616
)
1717

1818
var (
19+
// Client the http client wrapper.
1920
Client HTTPClient
20-
URL = "https://repo.jenkins-ci.org/releases/org/jenkins-ci/main/jenkins-war/maven-metadata.xml"
21+
// URL the default url to query.
22+
URL = "https://repo.jenkins-ci.org/releases/org/jenkins-ci/main/jenkins-war/maven-metadata.xml"
2123
)
2224

2325
func init() {
2426
Client = &http.Client{}
2527
}
2628

29+
// HTTPClient interface that wraps the Do function.
2730
type HTTPClient interface {
2831
Do(req *http.Request) (*http.Response, error)
2932
}

pkg/version/semver.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ import (
1010
"github.com/pkg/errors"
1111
)
1212

13+
// Semver struct to store a semver.
1314
type Semver struct {
1415
Major string
1516
Minor string
1617
Patch string
1718
Prerelease string
1819
}
1920

21+
// NewVersion creates a new Semver.
2022
func NewVersion(in string) Semver {
2123
s := Semver{}
2224

@@ -63,6 +65,7 @@ func toInt(in string) (int, error) {
6365
return s, nil
6466
}
6567

68+
// String string representation of this struct.
6669
func (v *Semver) String() string {
6770
if v.Minor == "" {
6871
return v.Major
@@ -75,6 +78,7 @@ func (v *Semver) String() string {
7578
}
7679
}
7780

81+
// LessThan returns true if this Semver is less than the supplied one.
7882
func (v Semver) LessThan(o Semver) bool {
7983
if v.Major != o.Major {
8084
val, err := v.lessThan(v.Major, o.Major)

0 commit comments

Comments
 (0)