mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-10-28 10:51:44 +01:00 
			
		
		
		
	Fix linter errors.
This commit is contained in:
		
							parent
							
								
									b6ae60cc44
								
							
						
					
					
						commit
						cb2ea300ad
					
				| @ -9,6 +9,16 @@ import ( | |||||||
| 	"google.golang.org/grpc/status" | 	"google.golang.org/grpc/status" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
|  | const ( | ||||||
|  | 	keyLength             = 64 | ||||||
|  | 	errPreAuthKeyTooShort = Error("key too short, must be 64 hexadecimal characters") | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | // Error is used to compare errors as per https://dave.cheney.net/2016/04/07/constant-errors
 | ||||||
|  | type Error string | ||||||
|  | 
 | ||||||
|  | func (e Error) Error() string { return string(e) } | ||||||
|  | 
 | ||||||
| func init() { | func init() { | ||||||
| 	rootCmd.AddCommand(debugCmd) | 	rootCmd.AddCommand(debugCmd) | ||||||
| 
 | 
 | ||||||
| @ -77,8 +87,8 @@ var createNodeCmd = &cobra.Command{ | |||||||
| 
 | 
 | ||||||
| 			return | 			return | ||||||
| 		} | 		} | ||||||
| 		if len(machineKey) != 64 { | 		if len(machineKey) != keyLength { | ||||||
| 			err = fmt.Errorf("key '%s' too short, must be 64 hexadecimal characters", machineKey) | 			err = errPreAuthKeyTooShort | ||||||
| 			ErrorOutput( | 			ErrorOutput( | ||||||
| 				err, | 				err, | ||||||
| 				fmt.Sprintf("Error: %s", err), | 				fmt.Sprintf("Error: %s", err), | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user