generate

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package generate provides functions for implementing generators.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Args

func Args() string

Args returns the command line arguments, starting with the base program name as a string.

func Dollar

func Dollar() string

Dollar returns the value of the $DOLLAR environment variable, or panics if the variable is not present.

func GoArch

func GoArch() string

GoArch returns the value of the $GOARCH environment variable, or panics if the variable is not present.

func GoCmd

func GoCmd(arguments []string) *exec.Cmd

GoCmd returns an *exec.Cmd to execute "$GOROOT/bin/go" with the given arguments.

func GoFile

func GoFile() string

GoFile returns the value of the $GOFILE environment variable, or panics if the variable is not present.

func GoGenerateCmd

func GoGenerateCmd(arguments []string) *exec.Cmd

GoCmd returns an *exec.Cmd to execute "$GOROOT/bin/go generate" with the given arguments.

func GoLine

func GoLine() string

GoLine returns the value of the $GOLINE environment variable, or panics if the variable is not present.

func GoOs

func GoOs() string

GoOs returns the value of the $GOOS environment variable, or panics if the variable is not present.

func GoPackage

func GoPackage() string

GoPackage returns the value of the $GOPACKAGE environment variable, or panics if the variable is not present.

func GoRoot

func GoRoot() string

GoRoot returns the value of the $GOROOT environment variable, or panics if the variable is not present.

func GoRunCmd

func GoRunCmd(pkg string, arguments []string) *exec.Cmd

GoCmd returns an *exec.Cmd to execute "$GOROOT/bin/go run" with the given arguments.

func WriteFile

func WriteFile(name string, data []byte, perm os.FileMode) error

WriteFile wraps os.WriteFile to use standard output if name is "-".

func WriteSource

func WriteSource(name string, data []byte, perm os.FileMode) error

WriteSource first passes data through format.Source before calling os.Writefile. Standard output will be used if name is "-".

Types

This section is empty.

Jump to

Keyboard shortcuts

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