func (b *CommandBuilder) AddRoutes(interfaceName string, ipConfig *types.IPConfig) executor.Command { var routeCommands []executor.Command for _, route := range ipConfig.Routes { routeCommand := commands.AddRoute{ Interface: interfaceName, Destination: route.Dst, Gateway: route.GW, } if routeCommand.Gateway == nil { routeCommand.Gateway = ipConfig.Gateway } routeCommands = append(routeCommands, routeCommand) } return commands.All(routeCommands...) }