mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-23 06:58:14 +02:00
Installateurs Unix fusionnes, staticcheck sans avertissement
- sys_install_unix.go porte le parcours commun (arborescence, lien du binaire, /etc/default, chown) ; Linux et macOS ne gardent que leur declaration de services derriere installServices/uninstallServices (395 -> 339 lignes, et surtout une seule copie a corriger) - l'installateur macOS pose desormais les DEUX services (il n'en posait qu'un) - API bbolt depreciee remplacee, message d'erreur duplique factorise - staticcheck.conf : ST1005 ecartee, avec la raison (messages francais montres a l'utilisateur). Le projet est a zero avertissement.
This commit is contained in:
1 parent
7ecd869da0
commit
1aabc0f9c7
6 files changed
+242
-283
No files matched your search
@@ -2,6 +2,7 @@ package ajean
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -9,6 +10,7 @@ import (
|
||||
"time"
|
||||
|
||||
bolt "go.etcd.io/bbolt"
|
||||
bolterrors "go.etcd.io/bbolt/errors"
|
||||
)
|
||||
|
||||
// store.go — l'unique endroit où AJEAN écrit son état.
|
||||
@@ -176,7 +178,7 @@ func allKV(bucket string) map[string]string {
|
||||
func replaceKV(bucket string, m map[string]string) error {
|
||||
return withDB(func(d *bolt.DB) error {
|
||||
return d.Update(func(tx *bolt.Tx) error {
|
||||
if err := tx.DeleteBucket([]byte(bucket)); err != nil && err != bolt.ErrBucketNotFound {
|
||||
if err := tx.DeleteBucket([]byte(bucket)); err != nil && !errors.Is(err, bolterrors.ErrBucketNotFound) {
|
||||
return err
|
||||
}
|
||||
b, err := tx.CreateBucket([]byte(bucket))
|
||||
|
||||
Reference in new issue
Block a user