mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-12-23 11:55:13 -07:00
feat(golang-rewrite): address linter warnings
This commit is contained in:
parent
c33a0faf75
commit
58634cfd7a
@ -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"
|
||||
|
@ -2,7 +2,6 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user