Documentation ¶
Overview ¶
Example ¶
package main import ( "fmt" "github.com/palantir/godel/apps/okgo/config" ) func main() { yml := ` release-tag: go1.7 checks: errcheck: args: - "-ignore" - "github.com/seelog:(Info|Warn|Error|Critical)f?" filters: - type: "message" value: "\\w+" ` cfg, err := config.LoadRawConfig(yml, "") if err != nil { panic(err) } if _, err := cfg.ToParams(); err != nil { panic(err) } fmt.Printf("%q", fmt.Sprintf("%+v", cfg)) }
Output: "{ReleaseTag:go1.7 Checks:map[errcheck:{Skip:false Args:[-ignore github.com/seelog:(Info|Warn|Error|Critical)f?] Filters:[{Type:message Value:\\w+}]}] Exclude:{Names:[] Paths:[]}}"
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Checker ¶
type Checker struct { // Skip specifies whether or not the check should be skipped entirely. Skip bool `yaml:"skip" json:"skip"` // Args specifies the command-line arguments provided to the check. Args []string `yaml:"args" json:"args"` // Filters specifies the filter definitions. Raw output lines that match the filter are excluded from // processing. Filters []Filter `yaml:"filters" json:"filters"` }
type OKGo ¶
type OKGo struct { // ReleaseTag specifies the newest Go release build tag supported by the codebase being checked. If this value // is not specified, it defaults to the Go release that was used to build the check tool. If the code being // checked is known to use a version of Go that is earlier than the version of Go used to build the check tool // and the codebase being checked contains build tags for the newer Go version, this value should be explicitly // set. For example, if the check tool was compiled using Go 1.8 but the codebase being checked uses Go 1.7 and // contains files that use the "// +build go1.8" build tag, then this should be set to "go1.7". ReleaseTag string `yaml:"release-tag" json:"release-tag"` // Checks specifies the configuration used by the checks. The key is the name of the check and the value is the // custom configuration for that check. Checks map[string]Checker `yaml:"checks" json:"checks"` // Exclude specifies the files that should be excluded from tests. Exclude matcher.NamesPathsCfg `yaml:"exclude" json:"exclude"` }
func LoadRawConfig ¶
Click to show internal directories.
Click to hide internal directories.