mirror of
				https://github.com/prometheus/prometheus.git
				synced 2025-10-31 08:21:16 +01:00 
			
		
		
		
	Make sure that the Go versions in all `go.mod` files are in sync. Signed-off-by: SuperQ <superq@gmail.com>
		
			
				
	
	
		
			13 lines
		
	
	
		
			295 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			295 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/usr/bin/env bash
 | |
| 
 | |
| readarray -t mod_files < <(find . -type f -name go.mod)
 | |
| 
 | |
| echo "Checking files ${mod_files[@]}"
 | |
| 
 | |
| matches=$(awk '$1 == "go" {print $2}' "${mod_files[@]}" | sort -u | wc -l)
 | |
| 
 | |
| if [[ "${matches}" -ne 1 ]]; then
 | |
|   echo 'Not all go.mod files have matching go versions'
 | |
|   exit 1
 | |
| fi
 |