*: fix warnings from go vet
This commit is contained in:
@@ -106,13 +106,13 @@ func Apply(cfg config.CloudConfig, env *Environment) error {
|
||||
|
||||
var writeFiles []system.File
|
||||
for _, file := range cfg.WriteFiles {
|
||||
writeFiles = append(writeFiles, system.File{file})
|
||||
writeFiles = append(writeFiles, system.File{File: file})
|
||||
}
|
||||
|
||||
for _, ccf := range []CloudConfigFile{
|
||||
system.OEM{cfg.Coreos.OEM},
|
||||
system.Update{cfg.Coreos.Update, system.DefaultReadConfig},
|
||||
system.EtcHosts{cfg.ManageEtcHosts},
|
||||
system.OEM{OEM: cfg.Coreos.OEM},
|
||||
system.Update{Update: cfg.Coreos.Update, ReadConfig: system.DefaultReadConfig},
|
||||
system.EtcHosts{EtcHosts: cfg.ManageEtcHosts},
|
||||
} {
|
||||
f, err := ccf.File()
|
||||
if err != nil {
|
||||
@@ -125,13 +125,13 @@ func Apply(cfg config.CloudConfig, env *Environment) error {
|
||||
|
||||
var units []system.Unit
|
||||
for _, u := range cfg.Coreos.Units {
|
||||
units = append(units, system.Unit{u})
|
||||
units = append(units, system.Unit{Unit: u})
|
||||
}
|
||||
|
||||
for _, ccu := range []CloudConfigUnit{
|
||||
system.Etcd{cfg.Coreos.Etcd},
|
||||
system.Fleet{cfg.Coreos.Fleet},
|
||||
system.Update{cfg.Coreos.Update, system.DefaultReadConfig},
|
||||
system.Etcd{Etcd: cfg.Coreos.Etcd},
|
||||
system.Fleet{Fleet: cfg.Coreos.Fleet},
|
||||
system.Update{Update: cfg.Coreos.Update, ReadConfig: system.DefaultReadConfig},
|
||||
} {
|
||||
units = append(units, ccu.Units()...)
|
||||
}
|
||||
|
@@ -61,7 +61,7 @@ func (tum *TestUnitManager) UnmaskUnit(unit *system.Unit) error {
|
||||
func TestProcessUnits(t *testing.T) {
|
||||
tum := &TestUnitManager{}
|
||||
units := []system.Unit{
|
||||
system.Unit{config.Unit{
|
||||
system.Unit{Unit: config.Unit{
|
||||
Name: "foo",
|
||||
Mask: true,
|
||||
}},
|
||||
@@ -75,7 +75,7 @@ func TestProcessUnits(t *testing.T) {
|
||||
|
||||
tum = &TestUnitManager{}
|
||||
units = []system.Unit{
|
||||
system.Unit{config.Unit{
|
||||
system.Unit{Unit: config.Unit{
|
||||
Name: "bar.network",
|
||||
}},
|
||||
}
|
||||
@@ -88,7 +88,7 @@ func TestProcessUnits(t *testing.T) {
|
||||
|
||||
tum = &TestUnitManager{}
|
||||
units = []system.Unit{
|
||||
system.Unit{config.Unit{
|
||||
system.Unit{Unit: config.Unit{
|
||||
Name: "baz.service",
|
||||
Content: "[Service]\nExecStart=/bin/true",
|
||||
}},
|
||||
@@ -102,7 +102,7 @@ func TestProcessUnits(t *testing.T) {
|
||||
|
||||
tum = &TestUnitManager{}
|
||||
units = []system.Unit{
|
||||
system.Unit{config.Unit{
|
||||
system.Unit{Unit: config.Unit{
|
||||
Name: "locksmithd.service",
|
||||
Runtime: true,
|
||||
}},
|
||||
@@ -116,7 +116,7 @@ func TestProcessUnits(t *testing.T) {
|
||||
|
||||
tum = &TestUnitManager{}
|
||||
units = []system.Unit{
|
||||
system.Unit{config.Unit{
|
||||
system.Unit{Unit: config.Unit{
|
||||
Name: "woof",
|
||||
Enable: true,
|
||||
}},
|
||||
|
@@ -98,7 +98,7 @@ func (e *Environment) Apply(data string) string {
|
||||
|
||||
func (e *Environment) DefaultEnvironmentFile() *system.EnvFile {
|
||||
ef := system.EnvFile{
|
||||
File: &system.File{config.File{
|
||||
File: &system.File{File: config.File{
|
||||
Path: "/etc/environment",
|
||||
}},
|
||||
Vars: map[string]string{},
|
||||
|
@@ -48,7 +48,7 @@ func PersistScriptInWorkspace(script system.Script, workspace string) (string, e
|
||||
|
||||
relpath := strings.TrimPrefix(tmp.Name(), workspace)
|
||||
|
||||
file := system.File{config.File{
|
||||
file := system.File{File: config.File{
|
||||
Path: relpath,
|
||||
RawFilePermissions: "0744",
|
||||
Content: string(script),
|
||||
@@ -58,7 +58,7 @@ func PersistScriptInWorkspace(script system.Script, workspace string) (string, e
|
||||
}
|
||||
|
||||
func PersistUnitNameInWorkspace(name string, workspace string) error {
|
||||
file := system.File{config.File{
|
||||
file := system.File{File: config.File{
|
||||
Path: path.Join("scripts", "unit-name"),
|
||||
RawFilePermissions: "0644",
|
||||
Content: name,
|
||||
|
Reference in New Issue
Block a user