diff --git a/aci/etchosts/hosts.go b/aci/etchosts/hosts.go index 468197ed3..4e856aa49 100644 --- a/aci/etchosts/hosts.go +++ b/aci/etchosts/hosts.go @@ -33,6 +33,10 @@ func SetHostNames(file string, hosts ...string) error { fmt.Println("Setting local hosts for " + strings.Join(hosts, ", ")) for _, host := range hosts { _, err = f.WriteString("\n127.0.0.1 " + host) + if err != nil { + return err + } } + _, err = f.WriteString("\n") return err } diff --git a/aci/etchosts/testdata/etchosts.golden b/aci/etchosts/testdata/etchosts.golden index 5416fde63..420b850b9 100644 --- a/aci/etchosts/testdata/etchosts.golden +++ b/aci/etchosts/testdata/etchosts.golden @@ -1,4 +1,4 @@ 127.0.0.1 foo 127.0.0.1 bar -127.0.0.1 zot \ No newline at end of file +127.0.0.1 zot