mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Replace interface{} with any (#25686)
				
					
				
			Result of running `perl -p -i -e 's#interface\{\}#any#g' **/*` and `make fmt`.
Basically the same [as golang did](2580d0e08d).
			
			
This commit is contained in:
		@@ -55,14 +55,14 @@ func isYAMLSeparator(line []byte) bool {
 | 
			
		||||
 | 
			
		||||
// ExtractMetadata consumes a markdown file, parses YAML frontmatter,
 | 
			
		||||
// and returns the frontmatter metadata separated from the markdown content
 | 
			
		||||
func ExtractMetadata(contents string, out interface{}) (string, error) {
 | 
			
		||||
func ExtractMetadata(contents string, out any) (string, error) {
 | 
			
		||||
	body, err := ExtractMetadataBytes([]byte(contents), out)
 | 
			
		||||
	return string(body), err
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ExtractMetadata consumes a markdown file, parses YAML frontmatter,
 | 
			
		||||
// and returns the frontmatter metadata separated from the markdown content
 | 
			
		||||
func ExtractMetadataBytes(contents []byte, out interface{}) ([]byte, error) {
 | 
			
		||||
func ExtractMetadataBytes(contents []byte, out any) ([]byte, error) {
 | 
			
		||||
	var front, body []byte
 | 
			
		||||
 | 
			
		||||
	start, end := 0, len(contents)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user