mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-31 02:03:20 -04:00 
			
		
		
		
	lint: enable nakedret (#7569)
Replace naked returns with explicit return values to satisfy nakedret linter and improve readability. Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
This commit is contained in:
		| @@ -13,6 +13,7 @@ linters: | |||||||
|     - govet |     - govet | ||||||
|     - ineffassign |     - ineffassign | ||||||
|     - intrange |     - intrange | ||||||
|  |     - nakedret | ||||||
|     - nolintlint |     - nolintlint | ||||||
|     - prealloc |     - prealloc | ||||||
|     - protogetter |     - protogetter | ||||||
|   | |||||||
| @@ -213,7 +213,7 @@ func (n *Node) insert(rr dns.RR) (root *Node, d int) { | |||||||
|  |  | ||||||
| 	root = n | 	root = n | ||||||
|  |  | ||||||
| 	return | 	return root, d | ||||||
| } | } | ||||||
|  |  | ||||||
| // DeleteMin deletes the node with the minimum value in the tree. | // DeleteMin deletes the node with the minimum value in the tree. | ||||||
|   | |||||||
| @@ -192,7 +192,7 @@ func countRecords(result []dns.RR) (cname int, address int, mx int, sorted bool) | |||||||
| 			state = Any | 			state = Any | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 	return | 	return cname, address, mx, sorted | ||||||
| } | } | ||||||
|  |  | ||||||
| func handler() plugin.Handler { | func handler() plugin.Handler { | ||||||
|   | |||||||
| @@ -417,7 +417,7 @@ func parseAnswerRules(name string, args []string) (auto bool, rules ResponseRule | |||||||
| 	if auto && nameRules > 0 { | 	if auto && nameRules > 0 { | ||||||
| 		return false, nil, fmt.Errorf("auto name answer rule cannot be combined with explicit name anwer rules") | 		return false, nil, fmt.Errorf("auto name answer rule cannot be combined with explicit name anwer rules") | ||||||
| 	} | 	} | ||||||
| 	return | 	return auto, rules, nil | ||||||
| } | } | ||||||
|  |  | ||||||
| // hasClosingDot returns true if s has a closing dot at the end. | // hasClosingDot returns true if s has a closing dot at the end. | ||||||
|   | |||||||
| @@ -158,5 +158,5 @@ func templateParse(c *caddy.Controller) (handler Handler, err error) { | |||||||
| 		handler.Templates = append(handler.Templates, t) | 		handler.Templates = append(handler.Templates, t) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	return | 	return handler, nil | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user