github.com/gogf/gf@v1.16.9/.example/os/gres/gres_unpack.go (about) 1 package main 2 3 import ( 4 "github.com/gogf/gf/crypto/gaes" 5 "github.com/gogf/gf/os/gfile" 6 "github.com/gogf/gf/os/gres" 7 ) 8 9 var ( 10 CryptoKey = []byte("x76cgqt36i9c863bzmotuf8626dxiwu0") 11 ) 12 13 func main() { 14 binContent := gfile.GetBytes("data.bin") 15 binContent, err := gaes.Decrypt(binContent, CryptoKey) 16 if err != nil { 17 panic(err) 18 } 19 if err := gres.Add(binContent); err != nil { 20 panic(err) 21 } 22 gres.Dump() 23 }