Skip to content

Commit 2d9ae3b

Browse files
committed
Added NewConfig
1 parent 37ef4b3 commit 2d9ae3b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

config.go

+12-1
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,20 @@ type Job struct {
2525
ScriptArgs string
2626
}
2727

28+
// NewConfig initialises a new massh.Config.
29+
func NewConfig() *Config {
30+
c := &Config{
31+
Hosts: map[string]struct{}{},
32+
SSHConfig: &ssh.ClientConfig{},
33+
Job: &Job{},
34+
JobStack: &[]Job{},
35+
BastionHostSSHConfig: &ssh.ClientConfig{},
36+
}
37+
return c
38+
}
39+
2840
// SetHosts adds a slice of strings as hosts to config. Removes duplicates.
2941
func (c *Config) SetHosts(hosts []string) {
30-
c.Hosts = map[string]struct{}{}
3142
for i := range hosts {
3243
c.Hosts[hosts[i]] = struct{}{}
3344
}

0 commit comments

Comments
 (0)