lxd: github.com/lxc/lxd/shared/generate/file Index | Files

package file

import "github.com/lxc/lxd/shared/generate/file"

Package file contains helpers to write auto-generated Go source files.


Package Files

buffer.go doc.go snippet.go write.go

func Append Uses

func Append(path string, snippet Snippet) error

Append a code snippet to a file.

func Reset Uses

func Reset(path string, imports []string) error

Reset an auto-generated source file, writing a new empty file header.

type Buffer Uses

type Buffer struct {
    // contains filtered or unexported fields

Buffer for accumulating source code output.

func (*Buffer) L Uses

func (b *Buffer) L(format string, a ...interface{})

L accumulates a single line of source code.

func (*Buffer) N Uses

func (b *Buffer) N()

N accumulates a single new line.

type Snippet Uses

type Snippet interface {
    Generate(buffer *Buffer) error

Snippet generates a single code snippet of a target source file code.

Package file imports 6 packages (graph) and is imported by 10 packages. Updated 2020-04-15. Refresh now. Tools for package owners.