mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-12-23 20:05:09 -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
|
// Main entrypoint for the CLI app
|
||||||
package main
|
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
|
// Replaced with the real version during a typical build
|
||||||
var version = "v-dev"
|
var version = "v-dev"
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
package cli
|
package cli
|
||||||
|
|
||||||
import (
|
import (
|
||||||
_ "embed"
|
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
@ -16,6 +16,8 @@ import (
|
|||||||
//go:embed asdf.*
|
//go:embed asdf.*
|
||||||
var completions embed.FS
|
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) {
|
func Get(name string) (fs.File, bool) {
|
||||||
file, err := completions.Open("asdf." + name)
|
file, err := completions.Open("asdf." + name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -27,6 +29,7 @@ func Get(name string) (fs.File, bool) {
|
|||||||
return file, true
|
return file, true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Names returns a slice of shell names that completion is available for.
|
||||||
func Names() []string {
|
func Names() []string {
|
||||||
files, _ := fs.Glob(completions, "asdf.*")
|
files, _ := fs.Glob(completions, "asdf.*")
|
||||||
for i, file := range files {
|
for i, file := range files {
|
||||||
|
Loading…
Reference in New Issue
Block a user