mirror of
				https://github.com/tailscale/tailscale.git
				synced 2025-10-31 03:09:01 +00:00 
			
		
		
		
	cmd/printdep: add flag to print out Go toolchain tarball URL
Updates #3669 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
		 Brad Fitzpatrick
					Brad Fitzpatrick
				
			
				
					committed by
					
						 Brad Fitzpatrick
						Brad Fitzpatrick
					
				
			
			
				
	
			
			
			 Brad Fitzpatrick
						Brad Fitzpatrick
					
				
			
						parent
						
							3690bfecb0
						
					
				
				
					commit
					64c2657448
				
			| @@ -9,13 +9,16 @@ package main | ||||
| import ( | ||||
| 	"flag" | ||||
| 	"fmt" | ||||
| 	"log" | ||||
| 	"runtime" | ||||
| 	"strings" | ||||
| 
 | ||||
| 	ts "tailscale.com" | ||||
| ) | ||||
| 
 | ||||
| var ( | ||||
| 	goToolchain = flag.Bool("go", false, "print the supported Go toolchain git hash (a github.com/tailscale/go commit)") | ||||
| 	goToolchain    = flag.Bool("go", false, "print the supported Go toolchain git hash (a github.com/tailscale/go commit)") | ||||
| 	goToolchainURL = flag.Bool("go-url", false, "print the URL to the tarball of the Tailscale Go toolchain") | ||||
| ) | ||||
| 
 | ||||
| func main() { | ||||
| @@ -23,4 +26,21 @@ func main() { | ||||
| 	if *goToolchain { | ||||
| 		fmt.Println(strings.TrimSpace(ts.GoToolchainRev)) | ||||
| 	} | ||||
| 	if *goToolchainURL { | ||||
| 		var suffix string | ||||
| 		switch runtime.GOARCH { | ||||
| 		case "amd64": | ||||
| 			// None | ||||
| 		case "arm64": | ||||
| 			suffix = "-" + runtime.GOARCH | ||||
| 		default: | ||||
| 			log.Fatalf("unsupported GOARCH %q", runtime.GOARCH) | ||||
| 		} | ||||
| 		switch runtime.GOOS { | ||||
| 		case "linux", "darwin": | ||||
| 		default: | ||||
| 			log.Fatalf("unsupported GOOS %q", runtime.GOOS) | ||||
| 		} | ||||
| 		fmt.Printf("https://github.com/tailscale/go/releases/download/build-%s/%s%s.tar.gz\n", strings.TrimSpace(ts.GoToolchainRev), runtime.GOOS, suffix) | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user