memfsgen

command
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 24 Imported by: 0

README

A command to statically generate a memfs.FileSystem

Usage: memfsgen [options] <source-dir> <target-file>
  -mimetype value
        register a MIME type ("png:image/png", "txt:text/plain"…)
  -minify
        minify web assets
  -pkg string
        package name (default: lowercase name of <target-file> directory)
  -tag string
        build constraint
  -var string
        variable name (default "assets")

Typical usage will be through go generate:

//go:generate go run github.com/ncruces/go-fs/memfsgen -pkg main -var assets static assets.go

This generates a single assets.go file from the contents of directory static.

The file declares a single var assets *memfs.FileSystem in package main.

Documentation

Overview

A command to statically generate a memfs.FileSystem.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL