Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var BuildDirName = `build`
View Source
var BuildNameDelim = `-`
Functions ¶
func Build ¶
Build looks for a build.yaml file and does a go build as specified normally producing a build directory within the same directory as the build.yaml file. If no Name is set the name of the directory containing the build.yaml file is be used. If Dir is not set then the package variable BuildDirName is used.
Types ¶
type BuildParams ¶
type BuildParams struct {
// name of the binary to build
Name string
// delimiter between name, os, arch (BuildNameDelim)
Delim string
// relative directory to that containing build.yaml in which to build
Dir string
// target os and architectures to build
Targets []BuildTarget
// preserve anything extra in the yaml file when marshaling
O map[string]any `yaml:",inline"`
}
func ReadBuildParams ¶
func ReadBuildParams(path string) (*BuildParams, error)
ReadBuildParams looks in the path for build.yaml and returns a BuildParams from it.
Example ¶
package main
import (
"fmt"
"github.com/rwxrob/good"
)
func main() {
bp, err := good.ReadBuildParams(`testdata/foo`)
if err != nil {
fmt.Println(err)
}
fmt.Println(bp.Targets[0])
}
Output: {windows [amd64]}
func (BuildParams) YAML ¶
func (bp BuildParams) YAML() string
type BuildTarget ¶
Click to show internal directories.
Click to hide internal directories.