fvar

package module
v0.0.0-...-3a6f93b Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 5 Imported by: 2

README

fvar

Generates a map variable initialized with the contents of the folder.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSubfolder = errors.New("folder should not contain subfolder")

ErrSubFolder happens when the folder contains subfolder.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	Folder  string
	Package string
	VarName string
}

type Fvar

type Fvar struct{}

Fvar generates a map variable initialized with the contents of the folder.

func (Fvar) Generate

func (v Fvar) Generate(conf Conf) (bs []byte, err error)

Generate generates Golang source code that initializes the map variable with the contents of the folder - each key in the map is a file name, and the value is the file data.

Jump to

Keyboard shortcuts

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