From 58634cfd7aac9292be73e29d667a29156ca74e56 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Wed, 18 Dec 2024 16:22:12 -0500 Subject: [PATCH] feat(golang-rewrite): address linter warnings --- cmd/asdf/main.go | 2 +- internal/cli/cli.go | 1 - internal/completions/completions.go | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/asdf/main.go b/cmd/asdf/main.go index 85c958e5..997b062f 100644 --- a/cmd/asdf/main.go +++ b/cmd/asdf/main.go @@ -1,7 +1,7 @@ // Main entrypoint for the CLI app package main -import "github.com/asdf-vm/asdf/cli" +import "github.com/asdf-vm/asdf/internal/cli" // Replaced with the real version during a typical build var version = "v-dev" diff --git a/internal/cli/cli.go b/internal/cli/cli.go index cd8398f5..69d9386d 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -2,7 +2,6 @@ package cli import ( - _ "embed" "errors" "fmt" "io" diff --git a/internal/completions/completions.go b/internal/completions/completions.go index 7084073d..37338550 100644 --- a/internal/completions/completions.go +++ b/internal/completions/completions.go @@ -16,6 +16,8 @@ import ( //go:embed asdf.* var completions embed.FS +// Get returns a file containing completion code for the given shell if it is +// found. func Get(name string) (fs.File, bool) { file, err := completions.Open("asdf." + name) if err != nil { @@ -27,6 +29,7 @@ func Get(name string) (fs.File, bool) { return file, true } +// Names returns a slice of shell names that completion is available for. func Names() []string { files, _ := fs.Glob(completions, "asdf.*") for i, file := range files {