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.

Index

Package Files

buffer.go doc.go path.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 11 packages (graph) and is imported by 10 packages. Updated 2018-10-14. Refresh now. Tools for package owners.