mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 10:22:25 -05:00 
			
		
		
		
	- codeberg.org/gruf/go-ffmpreg: v0.6.11 -> v0.6.12 Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4458 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
		
			
				
	
	
		
			46 lines
		
	
	
	
		
			644 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
	
		
			644 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package embed
 | |
| 
 | |
| import (
 | |
| 	"compress/gzip"
 | |
| 	_ "embed"
 | |
| 	"io"
 | |
| 	"strings"
 | |
| )
 | |
| 
 | |
| func init() {
 | |
| 	var err error
 | |
| 
 | |
| 	// Wrap bytes in reader.
 | |
| 	r := strings.NewReader(s)
 | |
| 
 | |
| 	// Create unzipper from reader.
 | |
| 	gz, err := gzip.NewReader(r)
 | |
| 	if err != nil {
 | |
| 		panic(err)
 | |
| 	}
 | |
| 
 | |
| 	// Extract gzipped binary.
 | |
| 	b, err := io.ReadAll(gz)
 | |
| 	if err != nil {
 | |
| 		panic(err)
 | |
| 	}
 | |
| 
 | |
| 	// Set binary.
 | |
| 	s = string(b)
 | |
| }
 | |
| 
 | |
| // B returns a copy of
 | |
| // embedded binary data.
 | |
| func B() []byte {
 | |
| 	if s == "" {
 | |
| 		panic("binary already dropped from memory")
 | |
| 	}
 | |
| 	return []byte(s)
 | |
| }
 | |
| 
 | |
| // Free will drop embedded
 | |
| // binary from runtime mem.
 | |
| func Free() { s = "" }
 | |
| 
 | |
| //go:embed ffmpreg.wasm.gz
 | |
| var s string
 |