mirror of
				https://github.com/golang/go.git
				synced 2025-10-31 16:50:58 +00:00 
			
		
		
		
	cmd/api: handle empty API file, ignore -next in release
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/6298063
This commit is contained in:
		
							parent
							
								
									50452720ba
								
							
						
					
					
						commit
						0c2f0cca7c
					
				
					 1 changed files with 13 additions and 1 deletions
				
			
		|  | @ -28,6 +28,7 @@ import ( | ||||||
| 	"os/exec" | 	"os/exec" | ||||||
| 	"path" | 	"path" | ||||||
| 	"path/filepath" | 	"path/filepath" | ||||||
|  | 	"runtime" | ||||||
| 	"sort" | 	"sort" | ||||||
| 	"strconv" | 	"strconv" | ||||||
| 	"strings" | 	"strings" | ||||||
|  | @ -99,6 +100,13 @@ func setContexts() { | ||||||
| func main() { | func main() { | ||||||
| 	flag.Parse() | 	flag.Parse() | ||||||
| 
 | 
 | ||||||
|  | 	if !strings.Contains(runtime.Version(), "weekly") { | ||||||
|  | 		if *nextFile != "" { | ||||||
|  | 			fmt.Printf("Go version is %q, ignoring -next %s\n", runtime.Version(), *nextFile) | ||||||
|  | 			*nextFile = "" | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	if *forceCtx != "" { | 	if *forceCtx != "" { | ||||||
| 		setContexts() | 		setContexts() | ||||||
| 	} | 	} | ||||||
|  | @ -235,7 +243,11 @@ func fileFeatures(filename string) []string { | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		log.Fatalf("Error reading file %s: %v", filename, err) | 		log.Fatalf("Error reading file %s: %v", filename, err) | ||||||
| 	} | 	} | ||||||
| 	return strings.Split(strings.TrimSpace(string(bs)), "\n") | 	text := strings.TrimSpace(string(bs)) | ||||||
|  | 	if text == "" { | ||||||
|  | 		return nil | ||||||
|  | 	} | ||||||
|  | 	return strings.Split(text, "\n") | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // pkgSymbol represents a symbol in a package | // pkgSymbol represents a symbol in a package | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Russ Cox
						Russ Cox