Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
qasimwarraich committed Mar 31, 2023
1 parent c63fb9c commit 5ac873f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
9 changes: 4 additions & 5 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import (
"os"
"path/filepath"

"github.com/bespinian/livelint/internal/livelint"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/util/homedir"

"github.com/bespinian/livelint/internal/livelint"
)

type App struct {
Expand Down Expand Up @@ -46,9 +45,9 @@ func New(namespace string, deploymentName string, ui livelint.UserInteraction) (
if app.namespace == "" {
loadingRules := clientcmd.NewDefaultClientConfigLoadingRules()
kubeConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(loadingRules, nil)
kubeConfigNamespace, _, err := kubeConfig.Namespace()
if err != nil {
return nil, fmt.Errorf("error getting namespace from k8s config: %w", err)
kubeConfigNamespace, _, namespaceErr := kubeConfig.Namespace()
if namespaceErr != nil {
return nil, fmt.Errorf("error getting namespace from k8s config: %w", namespaceErr)
}
app.namespace = kubeConfigNamespace
}
Expand Down
13 changes: 6 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
package main

import (
"errors"
"fmt"
"os"

tea "github.com/charmbracelet/bubbletea"
"github.com/urfave/cli/v2"

"github.com/bespinian/livelint/internal/app"
"github.com/bespinian/livelint/internal/livelint"
tea "github.com/charmbracelet/bubbletea"
"github.com/urfave/cli/v2"
)

var buildversion, builddate, githash string

var errNoHome = errors.New("error finding your HOME directory")

func main() {
cli := &cli.App{
Name: "livelint",
Expand Down Expand Up @@ -55,7 +51,10 @@ func main() {

go func() {
defer bubbletea.Quit()
app.Start()
err = app.Start()
if err != nil {
exitWithErr(err)
}
}()

err = bubbletea.Start()
Expand Down

0 comments on commit 5ac873f

Please # to comment.