`extraHosts := append([]string{}, flExtraHosts.GetAll()...)` shoud also work.