Skip to content

Commit

Permalink
chore: fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
filipowm committed Jan 2, 2025
1 parent 88eea2d commit 64eb2b0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions fields/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/ulikunitz/xz"
"github.com/xor-gate/ar"
"io"
"net/http"
"net/url"
Expand All @@ -18,6 +16,8 @@ import (
"strings"

"github.com/iancoleman/strcase"
"github.com/ulikunitz/xz"
"github.com/xor-gate/ar"
)

func DownloadAndExtract(downloadUrl url.URL, outputDir string) error {
Expand Down Expand Up @@ -49,7 +49,7 @@ func DownloadAndExtract(downloadUrl url.URL, outputDir string) error {
}
}
if !targetInfo.IsDir() {
return fmt.Errorf("fields info isn't a directory")
return errors.New("fields info isn't a directory")
}
return nil
}
Expand Down
3 changes: 2 additions & 1 deletion fields/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
_ "embed"
"flag"
"fmt"
log "github.com/sirupsen/logrus"
"os"
"path"
"path/filepath"
"strings"

log "github.com/sirupsen/logrus"
)

func usage() {
Expand Down
6 changes: 4 additions & 2 deletions fields/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ package main
import (
"context"
"encoding/json"
"errors"
"fmt"
"github.com/hashicorp/go-version"
"go/format"
"net/http"
"net/url"
"os"
"path/filepath"

"github.com/hashicorp/go-version"
)

const (
Expand Down Expand Up @@ -65,7 +67,7 @@ func latestUnifiVersion() (*UnifiVersion, error) {
return NewUnifiVersion(firmware.Version.Core(), firmware.Links.Data.Href), nil
}

return nil, nil
return nil, errors.New("no Unifi Controller firmware found")
}

func determineUnifiVersion(versionMarker string) (*UnifiVersion, error) {
Expand Down

0 comments on commit 64eb2b0

Please sign in to comment.