func main() { defer glog.Flush() glog.CopyStandardLogTo("info") flag.Parse() runtime.GOMAXPROCS(runtime.NumCPU()) httpClientBuilder := http_client_builder.New() httpClient := httpClientBuilder.Build() latestVersion := golang_latest_version.New(httpClient.Get) urlByVersion := url_by_version.New() latestUrl := golang_latest_tar_gz_url.New(latestVersion.LatestGolangVersion, urlByVersion.GolangTarGzUrlForVersion) commandListProvider := func() command_list.CommandList { return command_list.New() } copier := debian_copier.New() zipExtractor := debian_zip_extractor.New() tarGzExtractor := debian_tar_gz_extractor.New() requestbuilderProvider := http_requestbuilder.NewHTTPRequestBuilderProvider() debianPackageCreator := debian_package_creator.New(commandListProvider, copier, tarGzExtractor.ExtractTarGz, zipExtractor.ExtractZip, httpClient.Do, requestbuilderProvider.NewHTTPRequestBuilder) creatorByReader := debian_package_creator_by_reader.New(commandListProvider, debianPackageCreator, tarGzExtractor.ExtractTarGz) latestDebianPackageCreator := debian_latest_package_creator.New(httpClient.Get, latestUrl.LatestGolangTarGzUrl, latestVersion.LatestGolangVersion, creatorByReader.CreatePackage) config_parser := debian_config_parser.New() writer := os.Stdout err := do(writer, latestDebianPackageCreator.CreateLatestDebianPackage, config_parser, *configPtr) if err != nil { glog.Exit(err) } }
func main() { defer glog.Flush() glog.CopyStandardLogTo("info") flag.Parse() runtime.GOMAXPROCS(runtime.NumCPU()) writer := os.Stdout httpClientBuilder := http_client_builder.New() httpClient := httpClientBuilder.Build() latestVersion := latest_version.New(httpClient.Get) err := do(writer, latestVersion.LatestGolangVersion) if err != nil { glog.Exit(err) } }