Compare commits

..

2 Commits

Author SHA1 Message Date
amery 7f571fe414 build-sys: use local asciigoat.org/ini
Signed-off-by: Alejandro Mery <amery@jpi.io>
2023-09-05 19:40:23 +00:00
amery 6abccca365 vscode: add asciigoat, cyclomatic and Wrapf to the dictionary
Signed-off-by: Alejandro Mery <amery@jpi.io>
2023-09-05 19:40:23 +00:00
4 changed files with 6 additions and 29 deletions
-1
View File
@@ -4,7 +4,6 @@
"ceph",
"cyclomatic",
"darvaza",
"gofrs",
"jpictl",
"Wrapf",
"zerolog"
+1 -5
View File
@@ -16,11 +16,7 @@ var envCmd = &cobra.Command{
return err
}
env, err := m.Env(*envExport)
if err != nil {
return err
}
_, err = env.WriteTo(os.Stdout)
_, err = m.Env(*envExport).WriteTo(os.Stdout)
return err
},
}
+2 -6
View File
@@ -14,12 +14,8 @@ import (
// GetCephFSID returns our Ceph's FSID
func (m *Zones) GetCephFSID() (uuid.UUID, error) {
if core.IsZero(m.CephFSID) {
// generate one
v, err := uuid.NewV4()
if err != nil {
return uuid.Nil, err
}
m.CephFSID = v
// TODO: generate one
return uuid.Nil, nil
}
return m.CephFSID, nil
}
+3 -17
View File
@@ -11,24 +11,15 @@ import (
type Env struct {
ZoneIterator
cephFSID string
export bool
export bool
}
// Env returns a shell environment factory
func (m *Zones) Env(export bool) (*Env, error) {
fsid, err := m.GetCephFSID()
if err != nil {
return nil, err
}
env := &Env{
func (m *Zones) Env(export bool) *Env {
return &Env{
ZoneIterator: m,
cephFSID: fsid.String(),
export: export,
}
return env, nil
}
// Zones returns the list of Zone IDs
@@ -47,12 +38,7 @@ func (m *Env) Zones() []int {
func (m *Env) WriteTo(w io.Writer) (int64, error) {
var buf bytes.Buffer
if m.cephFSID != "" {
m.writeEnvVar(&buf, m.cephFSID, "FSID")
}
m.writeEnvVarInts(&buf, m.Zones(), "ZONES")
m.ForEachZone(func(z *Zone) bool {
m.writeEnvZone(&buf, z)
return false