Documentation
¶
Overview ¶
Package cl compiles Go+ syntax trees (ast).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindGoModFile ¶ added in v0.9.0
func GetModulePath ¶ added in v0.9.0
Types ¶
type Config ¶ added in v0.9.0
type Config struct {
// Context specifies the context for the load operation.
// If the context is cancelled, the loader may stop early
// and return an ErrCancelled error.
// If Context is nil, the load cannot be cancelled.
Context context.Context
// Logf is the logger for the config.
// If the user provides a logger, debug logging is enabled.
// If the GOPACKAGESDEBUG environment variable is set to true,
// but the logger is nil, default to log.Printf.
Logf func(format string, args ...interface{})
// Dir is the directory in which to run the build system's query tool
// that provides information about the packages.
// If Dir is empty, the tool is run in the current directory.
Dir string
// WorkingDir is the directory in which to run gop compiler.
// TargetDir is the directory in which to generate Go files.
// If SrcDir or TargetDir is empty, it is same as Dir.
WorkingDir, TargetDir string
// Env is the environment to use when invoking the build system's query tool.
// If Env is nil, the current environment is used.
// As in os/exec's Cmd, only the last value in the slice for
// each environment key is used. To specify the setting of only
// a few variables, append to the current environment, as in:
//
// opt.Env = append(os.Environ(), "GOOS=plan9", "GOARCH=386")
//
Env []string
// BuildFlags is a list of command-line flags to be passed through to
// the build system's query tool.
BuildFlags []string
// Fset provides source position information for syntax trees and types.
// If Fset is nil, Load will use a new fileset, but preserve Fset's value.
Fset *token.FileSet
// GenGoPkg is called to convert a Go+ package into Go.
GenGoPkg func(pkgDir string, base *Config) error
// PkgsLoader is the Go+ packages loader (will be set if it is nil).
PkgsLoader *PkgsLoader
// CacheLoadPkgs set to cache all loaded packages or not.
CacheLoadPkgs bool
// NoFileLine = true means not generate file line comments.
NoFileLine bool
}
Config of loading Go+ packages.
type PkgsLoader ¶ added in v0.9.2
type PkgsLoader struct {
LoadPkgs gox.LoadPkgsFunc
BaseConfig *Config
// contains filtered or unexported fields
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.