diff --git a/waveshell/pkg/shexec/parser.go b/waveshell/pkg/shexec/parser.go index 506d18dcf..3ab56bf0f 100644 --- a/waveshell/pkg/shexec/parser.go +++ b/waveshell/pkg/shexec/parser.go @@ -43,7 +43,7 @@ func (e *ParseEnviron) Get(name string) expand.Variable { } func (e *ParseEnviron) Each(fn func(name string, vr expand.Variable) bool) { - for key, _ := range e.Env { + for key := range e.Env { rtn := fn(key, e.Get(key)) if !rtn { break @@ -229,7 +229,7 @@ func strMapToShellStateVars(varMap map[string]string) []byte { func getOrderedKeysStrMap(m map[string]string) []string { keys := make([]string, 0, len(m)) - for key, _ := range m { + for key := range m { keys = append(keys, key) } sort.Strings(keys) @@ -238,7 +238,7 @@ func getOrderedKeysStrMap(m map[string]string) []string { func getOrderedKeysDeclMap(m map[string]*DeclareDeclType) []string { keys := make([]string, 0, len(m)) - for key, _ := range m { + for key := range m { keys = append(keys, key) } sort.Strings(keys) @@ -456,7 +456,6 @@ func ParseShellStateOutput(outputBytes []byte) (*packet.ShellState, error) { if strings.Index(rtn.Version, "bash") == -1 { return nil, fmt.Errorf("invalid shell state output, only bash is supported") } - rtn.Version = rtn.Version cwdStr := string(fields[1]) if strings.HasSuffix(cwdStr, "\r\n") { cwdStr = cwdStr[0 : len(cwdStr)-2] @@ -512,7 +511,7 @@ func (d *DeclareDeclType) normalizeAssocArrayDecl() error { return err } keys := make([]string, 0, len(varMap)) - for key, _ := range varMap { + for key := range varMap { keys = append(keys, key) } sort.Strings(keys) @@ -574,7 +573,7 @@ func strMapsEqual(m1 map[string]string, m2 map[string]string) bool { return false } } - for key, _ := range m2 { + for key := range m2 { _, found := m1[key] if !found { return false diff --git a/waveshell/pkg/shexec/shexec.go b/waveshell/pkg/shexec/shexec.go index ce8103326..a5fe4785d 100644 --- a/waveshell/pkg/shexec/shexec.go +++ b/waveshell/pkg/shexec/shexec.go @@ -808,7 +808,6 @@ func RunInstallFromCmd(ctx context.Context, ecmd *exec.Cmd, tryDetect bool, mshe } return fmt.Errorf("invalid response packet '%s' received from client", pk.GetType()) } - return fmt.Errorf("did not receive version string from client, install not successful") } func RunInstallFromOpts(opts *InstallOpts) error { diff --git a/waveshell/pkg/statediff/mapdiff.go b/waveshell/pkg/statediff/mapdiff.go index b88628bbc..8041a9499 100644 --- a/waveshell/pkg/statediff/mapdiff.go +++ b/waveshell/pkg/statediff/mapdiff.go @@ -38,7 +38,7 @@ func makeMapDiff(oldMap map[string]string, newMap map[string]string) MapDiffType continue } } - for name, _ := range oldMap { + for name := range oldMap { _, found := newMap[name] if !found { rtn.ToRemove = append(rtn.ToRemove, name)