Documentation ¶
Overview ¶
Package gofiles provides functions for specifying and writing Go source files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Write ¶
func Write(dir string, files []GoFileSpec) (map[string]GoFile, error)
Write the Go files represented by the specifications in the files parameter using the provided directory as the root directory.
Returns a map of the written files where the key is the RelPath field of the specification that was written and the value is the GoFile that was written for the specification.
Types ¶
type GoFile ¶
type GoFile struct { // The absolute path to the Go file. Path string // The import path for the Go file. For example, "github.com/nmiyake/pkg/gofiles". ImportPath string }
GoFile represents a Go file that has been written to disk.
type GoFileSpec ¶
type GoFileSpec struct { // The relative path to which the file should be written. For example, "foo/foo.go". RelPath string // Content of the file. Src string }
GoFileSpec represents the specification for a Go file.
Click to show internal directories.
Click to hide internal directories.