mirror of
https://github.com/Jguer/yay.git
synced 2025-10-04 00:03:11 -04:00
Minor polishing using gometalinter.
This commit is contained in:
parent
2ca3f4d726
commit
6305f86a3a
1
.gitignore
vendored
1
.gitignore
vendored
@ -21,3 +21,4 @@ _cgo_export.*
|
||||
*.test
|
||||
*.prof
|
||||
yay
|
||||
*.tar.gz
|
||||
|
1
Makefile
1
Makefile
@ -19,7 +19,6 @@ build:
|
||||
go build -v -o ${OUTPUT}/${PKGNAME} ${LDFLAGS}
|
||||
release:
|
||||
GOARCH=${ARCH64} go build -v -o ${OUTPUT}/${PKGNAME} ${LDFLAGS}
|
||||
cp ./LICENSE ${OUTPUT}
|
||||
cp ./yay.8 ${OUTPUT}
|
||||
cp ./zsh-completion ${OUTPUT}
|
||||
cp ./yay.fish ${OUTPUT}
|
||||
|
1
clean.go
1
clean.go
@ -29,7 +29,6 @@ func removeVCSPackage(pkgs []string) {
|
||||
}
|
||||
|
||||
_ = saveVCSInfo()
|
||||
return
|
||||
}
|
||||
|
||||
// CleanDependencies removes all dangling dependencies in system
|
||||
|
16
cmd.go
16
cmd.go
@ -94,8 +94,8 @@ func init() {
|
||||
// Save the default config if nothing is found
|
||||
config.saveConfig()
|
||||
} else {
|
||||
cfile, err := os.OpenFile(configFile, os.O_RDWR|os.O_CREATE, 0644)
|
||||
if err != nil {
|
||||
cfile, errf := os.OpenFile(configFile, os.O_RDWR|os.O_CREATE, 0644)
|
||||
if errf != nil {
|
||||
fmt.Println("Error reading config:", err)
|
||||
} else {
|
||||
defer cfile.Close()
|
||||
@ -378,23 +378,23 @@ func numberMenu(pkgS []string, flags []string) (err error) {
|
||||
}
|
||||
|
||||
// Complete provides completion info for shells
|
||||
func complete() (err error) {
|
||||
func complete() error {
|
||||
path := completionFile + config.Shell + ".cache"
|
||||
|
||||
if info, err := os.Stat(path); os.IsNotExist(err) || time.Since(info.ModTime()).Hours() > 48 {
|
||||
os.MkdirAll(filepath.Dir(completionFile), 0755)
|
||||
out, err := os.Create(path)
|
||||
if err != nil {
|
||||
return err
|
||||
out, errf := os.Create(path)
|
||||
if errf != nil {
|
||||
return errf
|
||||
}
|
||||
|
||||
if createAURList(out) != nil {
|
||||
defer os.Remove(path)
|
||||
}
|
||||
err = createRepoList(out)
|
||||
erra := createRepoList(out)
|
||||
|
||||
out.Close()
|
||||
return err
|
||||
return erra
|
||||
}
|
||||
|
||||
in, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE, 0644)
|
||||
|
@ -27,7 +27,6 @@ const (
|
||||
// Configuration stores yay's config.
|
||||
type Configuration struct {
|
||||
BuildDir string `json:"buildDir"`
|
||||
CleanAfter bool `json:"cleanAfter"`
|
||||
Editor string `json:"editor"`
|
||||
MakepkgBin string `json:"makepkgbin"`
|
||||
Shell string `json:"-"`
|
||||
@ -40,9 +39,10 @@ type Configuration struct {
|
||||
TimeUpdate bool `json:"timeupdate"`
|
||||
NoConfirm bool `json:"noconfirm"`
|
||||
Devel bool `json:"devel"`
|
||||
CleanAfter bool `json:"cleanAfter"`
|
||||
}
|
||||
|
||||
const version = "2.217"
|
||||
const version = "2.219"
|
||||
|
||||
// baseURL givers the AUR default address.
|
||||
const baseURL string = "https://aur.archlinux.org"
|
||||
|
Loading…
x
Reference in New Issue
Block a user