mirror of
				https://github.com/cheat/cheat.git
				synced 2025-11-04 07:45:28 +01:00 
			
		
		
		
	chore: removes the tj/front dependency
				
					
				
			Removes the `tj/front` dependency due to licensing concerns. See #490.
This commit is contained in:
		
							
								
								
									
										16
									
								
								vendor/github.com/tj/front/Readme.md
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								vendor/github.com/tj/front/Readme.md
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -1,16 +0,0 @@
 | 
			
		||||
# Front
 | 
			
		||||
 | 
			
		||||
Frontmatter unmarshaller, couldn't find one without a weird API.
 | 
			
		||||
 | 
			
		||||
## Badges
 | 
			
		||||
 | 
			
		||||
[](https://godoc.org/github.com/tj/front)
 | 
			
		||||

 | 
			
		||||

 | 
			
		||||
[](https://apex.sh/ping/)
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
> [tjholowaychuk.com](http://tjholowaychuk.com)  · 
 | 
			
		||||
> GitHub [@tj](https://github.com/tj)  · 
 | 
			
		||||
> Twitter [@tjholowaychuk](https://twitter.com/tjholowaychuk)
 | 
			
		||||
							
								
								
									
										24
									
								
								vendor/github.com/tj/front/front.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								vendor/github.com/tj/front/front.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -1,24 +0,0 @@
 | 
			
		||||
// Package front provides YAML frontmatter unmarshalling.
 | 
			
		||||
package front
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"bytes"
 | 
			
		||||
 | 
			
		||||
	"gopkg.in/yaml.v1"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Delimiter.
 | 
			
		||||
var delim = []byte("---")
 | 
			
		||||
 | 
			
		||||
// Unmarshal parses YAML frontmatter and returns the content. When no
 | 
			
		||||
// frontmatter delimiters are present the original content is returned.
 | 
			
		||||
func Unmarshal(b []byte, v interface{}) (content []byte, err error) {
 | 
			
		||||
	if !bytes.HasPrefix(b, delim) {
 | 
			
		||||
		return b, nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	parts := bytes.SplitN(b, delim, 3)
 | 
			
		||||
	content = parts[2]
 | 
			
		||||
	err = yaml.Unmarshal(parts[1], v)
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user