Skip to content

A simple library to restore Go assets from "embed" module

License

Notifications You must be signed in to change notification settings

ChromeTemp/RestoreAssets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RestoreAssets CI

A simple library to restore Go assets from "embed" module

Why?

Coming from go-bindata, it's not so easy to restore assets from "embed" module, since doesn't provide the go-bindata function RestoreAssets.

This library tries to solve this problem.

Usage

package main

import (
    "github.com/ChromeTemp/RestoreAssets"
    "embed"
)

//go:embed assets/*
var assets embed.FS

func main() {
    // Restore all assets to "app_data" directory
    RestoreAssets.From(&assets, "app_data")
}

Note: this only works for folders embedded with "embed" module and not for files.


Copyright (c) 2022 ChromeTemp, released under the MIT License

ChromeTemp by Giorgio Bellisario

About

A simple library to restore Go assets from "embed" module

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages