feat(golang-rewrite): address linter warnings

This commit is contained in:
Trevor Brown 2024-12-18 16:22:12 -05:00
parent c33a0faf75
commit 58634cfd7a
3 changed files with 4 additions and 2 deletions

View File

@ -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"

View File

@ -2,7 +2,6 @@
package cli
import (
_ "embed"
"errors"
"fmt"
"io"

View File

@ -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 {